Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

9 years ago by denkle

TouchButton Plugin for Impact. With fix for scaled Canvas

https://gist.github.com/den-kle/0e150dc4bc162f934734cba1974402f8

8 years ago by zouzouek

I'm having an issue with this plugin as well as the original impactjs plugin. Once i touch the button , the character moves infinitely and doesn't stop with touchend. Also the console shows the following error in the console :

Cannot set property 'right' of undefined

This fires at line 111 at the statement

ig.input.presses[this.action] = true;

I'm initializing my buttons as such :

            this.buttons = new ig.TouchButtonCollection([
                new ig.TouchButton( 'left', {left: 0, bottom: 0}, ig.system.width/2 - 8, ig.system.height ),
                new ig.TouchButton( 'right', {right: 0, bottom: 0}, ig.system.width/2 - 8, ig.system.height),

            ]);
            
            this.buttons.align();
        }

Any idea what could be causing the issue?
Page 1 of 1
« first « previous next › last »