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

1 decade ago by jaygarcia

Hi,

I'm really new here (and to ImpactJS), but I noticed that the click event fires for the duration of mousedown, and ends with mouseup. Click events should be "mousedown" & "mouseup", like it is in the DOM.

Thoughts?

update : function() {

    if (ig.input.state('click')) {
        console.log('click!')
    }
    this.parent();
}

1 decade ago by Graphikos

Use ig.input.pressed() instead of .state().

http://impactjs.com/documentation/class-reference/input#pressed

1 decade ago by Arantor

Yup, .state() is 'if the button is currently down', which means that you can do things you can't do as easily using the DOM, namely holding a button down and being able to receive that input continuously per frame.

1 decade ago by jaygarcia

Thanks guys :).

I guess the biggest problem I see is that i'm too used to the static world of HTML events, where there is one click event per node, not continuous. :)

.pressed() seemed to work for the time being.

I'm building an othello game with ImpactJS and am hoping to use this to promote the hell out of this framework. Here is a quick demo of the prototype flipping chip: http://moduscreate.com/i/2011-12-21_0010.swf

Again thank you.
Page 1 of 1
« first « previous next › last »