I love your playlist, I ll share my little game once I finish the tutorial. About that unexpected interaction at 14:42... I assume you expected when you hold the mouse down, move the pointer away from "girl" and back on you'd keep pointer down texture, but what happened is it changed to pointer over upon entering. This is because onPointerOver() is not checking if pointerIsOver value to set the texture (witch is like the past state of over event). Like in the previous video onPointerOver() should be function doPointerOver(e){ if(!pointerIsOver){ girl.texture = app.loader.resources["over"].texture; pointerisOver = true; } } Much love stay safe in these hard times.
@harm9912 жыл бұрын
texture creation from a spritesheet.png file with fixed width and height?
@martimiz4 жыл бұрын
Hi, first of all many thanks for a very nice set of tutorials!!! I was just wondering if it is really necessary to implement pointerIsOver? I was thinking that onpointerup you would always be over, because if not you would be onpointerupoutside (which could again never be over). I found no difference on leaving it out. Please tell me where I'm wrong :)
@dowerchin4 жыл бұрын
The pointer over event is useful if you want something to happen when the mouse pointer enters the sprite in question. If you don't need that type of event then you can skip it. In my example, the girl does react when the pointer is over, and behaves differently when the pointer is down, while over the sprite.
@martimiz4 жыл бұрын
thanks for you reply @@dowerchin, I was actually referring to the pointerIsOver flag, not to the pointerover event. I did code along with you, and just couldn't find the need for that particular flag, so I was wondering if I was missing something, is all :)