Hi,
===============================
UPDATE : Now available Gideros Coding Easy is a lib that provides anchor points for Sprites but also other useful things.
At some point, this library will (or will not) be included in Gideros. I think it has not been clearly defined yet.
===============================
are there any reason why those methods are available for Bitmap and not directly from Sprite?
I can see many cases where it would be very useful.
So if there are no particular technical reasons that make it impossible to do, I would like to add my voice for this request.
Note : the last related discussion that I found happened in nov 2011 :
link.
Comments
However I think you could implement it yourself by overriding the Sprite:setPosition() method and checking the bounds and translating the position yourself with something like this.
Likes: jack0088
#MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
Website: http://www.castlegateinteractive.com
https://play.google.com/store/apps/developer?id=Castlegate+Interactive
PS: @atilim: you should hurry with the AnchorPoint for Sprites! )
»Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
»Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
But I think you want change the die point (center registration point) , and in that case maybe better to use the Matrix. In this case you can use also the rotation well.
I don't know well if in Gideros , we van all things what in as .
Look at here, maybe it is useful info for you:
http://docs.brajeshwar.com/as2/flash/geom/Matrix.html
@atilim how will be manage the setAnchorPoint for Sprite (setY, getX, etc...)?
@atilim, in the further will have be to possibility implement Matrix classs in Gideros similar to as3 , obviously not with all methods :P
Whit this you can creat in same situations 2D , and for fake 3D and also for color.
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/geom/Matrix.html
And about matrix, you can check one of my classes, I used for basic matrix abstraction, when migrating from Javascript Canvas to Gideros
http://appcodingeasy.com/Gideros-Mobile/Abstracting-matrix-transformation-in-Gideros-Mobile
Btw. this was my matrix transformation try:
»Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
Can't you just rewrite methods to return what you want?
Likes: jack0088
»Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
[ Link ]
However, in my case, I couldn't make it work yet.
I get a few errors when I'm trying to use it, at project's startup :
Also, it would be great if it was supported by Gideros Studio.
@atilim is an official Sprite:setAnchorPoint() coming in a soon to be released version of Gideros?
»Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
This is strange, I use
I didn't change anything, I included AnchorPoints.lua, Helpers.lua (event Primitives.lua) in my project and checked the code execution order. Mmm..
Will check again when I have more time, I was wondering if you had already faced this issue.
https://github.com/gideros/gideros
https://www.youtube.com/c/JohnBlackburn1975
@Mells: no didn't expirience it. But I'll look into it a little later.
»Gideros Illustrator« - [svg|xml] scene designer using Adobe Illustrator®™ Within one line of code!
---------------------------------------
You give me the opportunity to close the loop : Gideros Coding Easy is a lib that provides anchor points for Sprites but also other useful things.
At some point, this library will (or will not) be included in Gideros. I think it has not been clearly defined yet.
Note : I have updated the comment at the top so that users will all be informed from now and in the future.
https://deluxepixel.com