All position, rotation and scale operations will happen relative to the set anchor point instead of to. Sets the anchorpoint of the sprite that affects the point at which rotation and scaling take place around. AnchorSprite adds anchor support to the built-in Sprite. rect myspriteimg.getrect () while (1) if keydown left: direction -30,0 elif keydown right. It should be very simple, here is some pseudo-code of what my program does so far. This adds two new functions to the Sprite class: How can I get the coordinates of a sprite's position in pygame What' I'm trying to do is prevent my sprite from going off the borders in a game I'm writing. You have to use GTween instead of MovieClip with this. #GIDEROS FIND RELATIVE COORDINATES OF SPRITE CODE#That means that MovieClip will bypass all of this code and will make objects react as if they have an anchor of (0,0) again. In practice it seems to be negligible, but keep that in mind if you are modifying the position, rotation or scale of a lot of Sprites with non-zero anchors at once.Īlso, only things that call Sprite functions in Lua will be affected by this. Now the official event, in the game settings -> recommended bonus -> add recommender EOS account, recommenders and referees can get 1000 magic water for. The functions you'll be interested in are: window.mapPixelToCoords or window.mapCoordsToPixel. Either convert the world coordinates to pixel coordinates or the other way around. It will come at the cost of increased overhead, especially new table lookups and a lot of matrix multiplication. Re: How do I get mouse position relative to a sprite Reply 3 on: October 14, 2013, 08:05:46 pm. This moves a lot of calculations into the Lua space instead of the base of Gideros for all objects based on the Sprite object that have an anchor set.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |