[Solved] How to make a good looking popup notification?

i try to make a notification popup with a scale-in effect, but it don’t looks like expected…

i have a sprite as background an a changeable text over it, but they do not scale from the same point…

here it is…

and this is where it looks at a scale of 0.1…
grafik

and here is my code…

why did these 2 objects behave different?
and is there a better way of doint this?
i would prefer to set it on an own layer, but the layer can’t have any scale-effects…
i also tried to use an object group, but i dont understand the use of it… i can’t do anything with these group…

Have you tried when you change its pos to NotificationPopup.X()+(Notificationpopup.Width()/2)-(notificationtext.Width()/2)?

1 Like

no, that did not solve the problem…
i just use NotificationPopup.X() and it seems to work for the x-Position, but i don’t understand why…
the y-Position is still wrong…

If you add a point on the background object, you can reposition the text while the tween is playing. Positioning the point would probably require a little trial and error. I also moved the origin point to the center.

Great!! that works fine.

For my understanding:
The text-element has no centerd origin? Because of this, my way did not work and the scaling looked different?
Now I “pin” the text on the scaling background and the text scales from this point to right and bottom?

You can’t change the points of the text. I was refering to the background sprite. I’m not sure if that’s what you were asking.

Text objects do have X() Y() and CenterX() CenterY() and you can position them either way.

Unfortunately, not every action or condition has a way to choose which point.

Your solution works perfect…

My question was:
a sprite seems to scale up from the center,
the textobject looked like it scales up from the top left…

is that right? and if so, is this ‘scaling-behavior’ changeable?

I don’t think you can change the scale origin point for a text object. You would just have to move the text object to compensate. As it grows, you move it to the left and up. Or in my example, the point on the other object as it gets scaled

Perfect, that answers my question.

Thanks a lot…

1 Like