Defold 1.2.151 has been released

pinned globally #2
0 Likes

#3

Yeees, cursor! Finally :smiley: I’ll show you what I needed it for, soon! :smiley:

9 Likes

#4

Great one on cursor!!!

I thought this was going to ship with 1.2.151

Is it only on the alpha channel?

3 Likes

#5

It should be available now I think. @mats.gisselson?

3 Likes

#6

Thanks! :100:

4 Likes

#7

How does this work? I tried setting cursor property values but nothing changes.

playback_rate does seem to work fine.

function init(self)
	local num =  math.random(30)
	print(num)
	go.set("#sprite", "playback_rate",math.random(num))
end

Got it working

function init(self)
	local num =  math.random(30) / 30
	print(num)
	sprite.play_flipbook("#sprite", "spin", nil, {offset = num})
end

Has to be a value between 0-1? And has to be used on play_flipbook also it’s called offset not cursor. playback_rate can be set here too.

This is awesome! Really useful for spawning things on the same frame and giving them some random variation in animations. :slight_smile:

4 Likes

"playback_rate" for sprites doesn't work
#8

There is more information in API documentation: https://www.defold.com/ref/sprite/#sprite.play_flipbook:url-id--complete_function---play_properties-

3 Likes

#9

I haven’t had time to use it myself, but setting the cursor and playback_rate properties should work?
(Let’s ping @sven who implemented it)

4 Likes

#10

You’re right they both do work with go.set I just wasn’t setting cursor in the normalized 0-1 range.

go.set("#sprite", "cursor", 0.5) -- works
6 Likes

#11

Me after reading this :

7 Likes

#12

What exactly is the flipbook cursor for? I have looked at the documentation but don’t understand what it is for.

2 Likes

#13

It lets you choose which frame of an animation to set the sprite’s animation to in code. So if you do #/total frames you can select a specific frame.

go.set("#sprite", "cursor", 0/30) -- starts animation on first frame

This is useful because if you have say birds with flipbook animations and you want to spawn them on the same engine frame you can set their cursor/offset randomly so that they are not all playing the animation in the same exact way. You could add extra random playback speed to get each bird even more personality.

Previously to get similar effect we had to add multiple animations to the same atlas which started and ended on a different section of animation loops. Now it’s much cleaner.

There are other application as well, such as temporarily setting the animation speed super low for paralysis effects for example.

10 Likes

#14

I understand now. Thanks!

2 Likes

#15

So the most basic use case I needed it for are the wind affected objects:

Moreover, the speed of a hero in an RPG game could be leveled up, so it’s nice to also increase the framerate of the running animation in parallel with increased movement speed.

Next, I could now check what frame of the animation attack is actually playing and apply some effect then, for example in the frame when the sword hits the mob the mob should play a hurt animation and the damage should be calculated and displayed above the mob, and even some particlefx could be played in that particular moment!

We are going in the direction where we could animate almost anything and it gives developers infinite possibilities! :star_struck: It’s great! :smiley: Thank you very much!

11 Likes

Pixel Art Witchcrafter - RPG Puzzle Story
#16

P.S. On my Opera browser the movies are unavailable on the forum :frowning: Works in Chrome and Edge.

2 Likes

#17

Awesome, thanks! I know it’s way past time I learned to use gitHub, but messing around with external apps to do this gives me a headeache when all I really need is a convenient way to copy the latest version to a different computer and Defold’s inbuilt tools are good enough for that.

I’ll get there eventually, but until then the download link is going to be really helpful.

2 Likes

#18

@Oleg_The_Evangelist Video suggestion: using cursors in animations :smiley:

6 Likes

#19

It is available in the editor you can download from the Dashboard. If you’re not seeing the new Toggle Assets Pane menu item under the View menu, and you’re not seeing an Update Available notification, you might have ended up on the “stable” release channel. The “stable” release channel currently does not actually mean “more reliable” as you might expect. It only means that you’ll get very infrequent updates to the editor. To get back to frequent releases, you should re-download the editor from the Dashboard.
@gianmichele

3 Likes

#20

Thanks for this info on API.

1 Like

#21

Thank you again very much for this feature, Defold Editor is now super comfortable to use :wink:

4 Likes