Defold 1.2.151 has been released

#1

Defold 1.2.151

In this release we’ve added support for controlling flipbook animations using a cursor property on sprites.
You can also control their playback speed via the playback_rate property.

On HTML5 we’ve also added a more robust retry logic in case the assets are loading over a shaky connection.

We have also fixed an issue where some Facebook dialogs where not properly displayed when using the vanilla engine on Android.

Web

We have added a Project Download option to the Dashboard project list. You can use this functionality to easily download a project to archive it offline or to upload it to another version control service such as GitHub. More on importing into GitHub here (https://www.defold.com/manuals/project-setup/#_adding_the_project_to_github)

Engine

  • DEF-2249 - Added: Added cursor and playback rate control for flipbook animations.
  • DEF-3418 - Fixed: Improved retry logic when loading resources for a game in HTML5
  • DEF-3873 - Fixed: Fixed issue with facebook dialogs not working in non-NE builds.
  • DEF-3888 - Fixed: Crash when exiting the game in the project without display profiles
  • DEF-3898 - Fixed: Local push notifications crash
  • DEF-3896 - Fixed: NE - Added vectormath_aos.h to dmsdk/sdk.h

Editor

  • DEFEDIT-1614 and DEFEDIT-1642 - Fixed: Very fast keyboard shortcut invocations could occasionally get lost.
  • DEFEDIT-1627 - Added: The splash screen now indicates release channel and editor revision.
  • DEFEDIT-1636 - Fixed: Stopped the editor from mistakenly picking up some Java environment variables.
  • DEFEDIT-1646 - Fixed: Exception when using the Simulate Resolution feature.
  • DEFEDIT-1650 - Fixed: Overridden vector property fields are no longer black.
22 Likes

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

#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

#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