Anchor on screen button

2wasted2

  • *
  • Posts: 26
Hay guys

So when I start my main Actor in the middle of a scene I use the  'create actor' block to spawn my on screen controls to where my main actor is...
When I do this the buttons appear
But
As soon you use the anchor block they dont appear???

If I start my actor in the normal top left it's fine
But when I want to start my actor away from the normal start position I can not get my controls to move with him

Many Thanks
Mike


Luyren

  • *
  • Posts: 2176
Post your code.
As a blind guess, you are not accounting for the screen position when creating your actors. Creat them at X/Y of camera plus the desired position on screen.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

2wasted2

  • *
  • Posts: 26
Thank you for your feedback

I'm away from the office at the mo, but I can tell you I just use in the scene events

"When Created"
Create actor at X and Y

Which works, but when I follow up with "Anchor"
It dosnt show

When you say set it to the camera position is there a block for that, surly the Camera is set to focus on my player.

Think I'm confusing myself lol

Thanks
Mike

Luyren

  • *
  • Posts: 2176
Yes, there are blocks to get the current screen X and Y. Use that plus your desired position on screen, then anchor it.
My Stencyl resources are available here: https://luyren.itch.io/
Cutscenes, RPG Elements, Particles, Map System and many more.
Twitter

2wasted2

  • *
  • Posts: 26
I Will be back soon and will have a look

Many Thanks
Mike

2wasted2

  • *
  • Posts: 26
Ok I think I have figured it out finally

I used Create actor at  x of camera + #
and y of camera + #

Thank you for your time

Mike