TOUR
PRICING
HELP
Stencylpedia
Blocks Guide
Sample Games
Developer Center
FORUMS
CHAT
#MADEINSTENCYL
EDUCATION
SIGN IN
×
Welcome back!
Username or E-mail
Password
(
Forgot?
)
C
OMMUNITY
Home
Issue Tracker
Inbox [0]
New Posts
New Replies
Search
Stencyl Community
→
Stencyl
→
Ask a Question
→
Is it possible to change the origin point of a created actor?
Pages:
1
Is it possible to change the origin point of a created actor?
tamercloud
Posts: 74
August 14, 2013, 11:23:41 am
I'm wondering if there is a way to create an actor at position x,y, but use the center of the actor as the reference point, not the corner. How can I do this?
TDonnally
Posts: 235
August 14, 2013, 07:49:32 pm
There is probably a way but I could never figure it out, and never bothered asking.
I just add width or height of self divided by 2 to get the center. It is rough, but it works.
thegenericbanana
Posts: 494
August 14, 2013, 10:12:32 pm
Well, I don't use this, but you can change "x" to "x-center". Like, "create actor at x: (x-center) of self y: (y-center) of self.
Same block as setting the X. I probably just misread, as this is pretty obvious stuff, but might as well say it.
Johnny Turbo's Surgery Frenzy
froz
Posts: 250
August 15, 2013, 08:14:09 am
If you want an actor you create to have a center at x,y, you need to create it at x minus half-width of that actor and y minus half-height of that actor. Since "width/height of self" blocks allow you to choose "half-width" etc. there is no need to manually divide it by 2.
So, what TDonnally set, except you need to diminish, not add half-width and half-height.
Eriko
Posts: 162
August 16, 2013, 01:49:27 am
What about change it in the appereance tab of the actor?. Right where you tell Stencyl to loop the animation for that actor.
Stencyl Ninja
Posts: 245
August 17, 2013, 01:36:05 am
One thing that I really liked about The Games Factory and other ClickTeam products was that you could set 2 different hotspots to wherever you wanted them with a nice visual interface.
I really wish that feature was in Stencyl too.
tamercloud
Posts: 74
August 19, 2013, 06:33:28 am
Ah, I was hoping there was a cleaner way to do it, but I'll just stay with the suggested methods so far. I hope stencyl is willing to add such a useful feature in future updates.
Pages:
1