How to make text “Spin In” (Custom Rule)


#1

Here’s a simple guide on how to make text or any object/image “spin in”to view on the screen. It’s easiest to set it up in a custom Rule.


The first two blocks are easy. Create a When Game Starts and a When Object Is Cloned block, and have each of them set the object size percent to 0. Easy:

Next, you will need an object variable. You may call it whatever you like, but I prefer one named State. The code will be made so that when you set an object State to 1, it shows up on the screen.

You will also need a variable to determine the max size. In this case, I named it Max Size. This is so then you can set different clones to different sizes, or different objects.

Since what I want to show doesn’t really fit into a screenshot, here it is as text:

When (self State = 1 AND self Size As A % < self Max Size){
    Set Angle(((self Max Size - self Size As A %) ÷ 3) ^ 2)
}

Now, let me explain how this works in case you want to adjust some things.

self Max Size - self Size As A % will make it so that no matter how big or small you create an object, it will always end with the rotation of 0. If you want an object at a different angle, perhaps 45°, you can do (self Max Size - self Size As A %) + 45.

÷ 3 adjusts the speed of the rotation. 1 makes it super fast, and 10 barely turns it at all. 3 is a good speed to go at.

^2 just makes it so the spinning starts fast as it’s tiny and slows down as it gets bigger. If you remove this, it will go at the same speed until it’s full size. If you make it bigger, it will spin incredibly fast.

Last step, something that adjusts the size. The when block is exactly the same as above, but with a different and simpler thing inside.

When (self State = 1 AND self Size As A % < self Max Size){
    Set Size Percent (self Size As A % + 1)
}

All this does is increase the size while the state is equal to 1 until it is full size.


This is made so that you can make objects appear like this whenever you’d like. Right away, after a few seconds, whenever. When you want it to, make sure you set the object’s Max Size and then set the it’s State to 1. See what I mean in my latest project.


I hope you find this useful! :smile:

If you’d like my to show how to make it so they spin off too (which you might just be able to figure it out on your own. Just make it so When self State = 2 AND self Size As A % > 0, Set Size Percent to self Size As A % - 1), I can add that here as well.


#2

This is really useful! Thank you for sharing your code. I’ll see if I can use that in any of my upcoming projects (with credit of course). Once again, great job! :slight_smile: