Bug Issue: Anchor actor to screen


Pages: 1

RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 07, 2018, 01:22:36 pm
Hi,

with 3.4 no problem, but with 3.5 9876, I have some problems with block "anchor".
I use some layer and I want to anchor specific actors to a specific layer. So I hide that layer and show it only when user do an action. Well, with 3.5, all actors that are anchor are hidden, and so the drawing too.

It seems that anchor change layer of actors with result that actors and drawing aren't showed anymore.

I hope that you can understand what I have wrote.


Edit.: Confirm. I have tested that the actor is create at layer 4 and then when I anchor it, the actor is switched to layer 1. It's a bug.
« Last Edit: May 07, 2018, 01:34:59 pm by RulezTeam »


rob1221

  • Master Stencyler
  • *
May 07, 2018, 02:09:27 pm
Anchoring is done by sending the actor to the HUD layer so there's no such thing as anchoring to a specific layer.  Hiding any of the normal scene layers should not affect anchored actors so maybe there's a bug there but I haven't tested anything, just took a brief look at the code.


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 07, 2018, 02:45:10 pm
Hi rob,
I've seen that in 3.4 version, the actors that is created on layer 4, after it has been anchored, the actors remain on layer 4 and it doesn't switch in layer 1 as it happen on 3.5.
The project is the same that I've exported from 3.4 and imported in 3.5, and this happen only on 3.5.
So, what should I look at my code ?


rob1221

  • Master Stencyler
  • *
May 07, 2018, 02:57:49 pm
It looks like the old anchoring code just added the actor to the HUD layer without removing it from the old layer so to some extent it was in two layers at the same time.  Are you sure the anchored actors are going to layer 1 in your scene instead of the HUD layer?  To me it sounds like you built your game mechanics around a bug that has been fixed.
  • Status changed from New to Need Info
« Last Edit: May 07, 2018, 02:59:17 pm by rob1221 »


New attachment added by RulezTeam - May 08, 2018, 12:23:49 am


New attachment added by RulezTeam - May 08, 2018, 12:23:58 am


RulezTeam

  • Subscriber - Stencyl Studio
  • *
May 08, 2018, 12:27:01 am
Hi rob,
I've attached two projects; one with 3.4 version and other make with 3.5.

If you try them, you can see that with 3.4, the actor remain on layer where it was created, while with 3.5 the actor switch to -1 layer.
So if I work on layer that I choose to create the actor every action that apply to that layer isn't apply (for example hide actor from that specif layer after some time, etc).

Is this how the anchor is suppose to work, or is it a bug ?


rob1221

  • Master Stencyler
  • *
May 08, 2018, 07:31:12 am
-1 is the ID of the HUD layer, which is where actors are sent to when they are anchored.  I don't think there is a bug here.

I assume you only want to use anchoring to keep actors on a certain screen position, and there are probably other ways of doing that.  Try setting your actor x/y based on the camera x/y.  If there is some jittering then maybe try drawing the actor image instead.  If everything on a given layer is affected then changing the scroll factor of the layer might also work.
  • Status changed from Need Info to Closed


Justin

  • Master Stencyler
  • *
May 08, 2018, 10:55:06 am
If you're wondering why this changed between 3.4 and 3.5, it was in order to treat the HUD itself as a layer of its own. This is useful because it allows stuff in the "when drawing" block to appear above an actor even if it's on the HUD layer.


Pages: 1

Details

  • Reported
    May 07, 2018, 01:22:36 pm
  • Updated
    May 08, 2018, 10:55:06 am

  • View Status
    Public
  • Type
    Bug
  • Status
    Closed
  • Priority
    Normal
  • Version
    3.5.0 beta 1
  • Fixed in
    (none)
  • Assigned to
    (none)
  • Category
    (none)

Tags


Attachments

* Anchor_3.4.stencyl (1347.73 kB - downloaded 9 times.)
* Anchor.stencyl (1075.33 kB - downloaded 10 times.)