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 TrexKikBut

I want to center my image on the cursor. Because it is setting to the top left.

I'm using this plugin:

https://github.com/datamosh/ImpactJS-GUI

1 decade ago by Datamosh

Later I will add offset (x / y) to the mouse cursor. In some cases it may be useful to specify where is the 'hotspot' in the image

1 decade ago by TrexKikBut

Quote from Datamosh
Later I will add offset (x / y) to the mouse cursor. In some cases it may be useful to specify where is the 'hotspot' in the image


How do I do that?

1 decade ago by Datamosh

Oh! I see that it is easier than I thought.

Change ig.gui.cursor.offset, for example:
ig.gui.cursor.offset = {
    x: 10,
    y: 12
}

(I will add to the example for future reference)

1 decade ago by Datamosh

Demo updated on github and little fix for cursor over the elements ;)
https://github.com/datamosh/ImpactJS-GUI
Page 1 of 1
« first « previous next › last »