So...how do I use routine class to add a delay to autoscrolling?

Post here for help and support regarding LunaLua and SMBX2's libraries and features.

Moderator: Userbase Moderators

FirestarPlays
Chain Chomp
Chain Chomp
Posts: 303
Joined: Tue Feb 28, 2017 1:26 pm
Pronouns: he/him

So...how do I use routine class to add a delay to autoscrolling?

Postby FirestarPlays » Sat Apr 17, 2021 4:29 pm

I might be being stupid, but how exactly do I do this? :?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9891
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: So...how do I use routine class to add a delay to autoscrolling?

Postby Emral » Sat Apr 17, 2021 5:01 pm

Same as how you would have used eventu in the past, just with the word Routine instead of eventu now.
https://wohlsoft.ru/pgewiki/EventU.lua

Example:

Code: Select all

local function myRoutine()
	Routine.waitFrames(64) -- wait 1 second
	Text.showMessageBox("Hello!")
end

function onStart()
	Routine.run(myRoutine)
end

FirestarPlays
Chain Chomp
Chain Chomp
Posts: 303
Joined: Tue Feb 28, 2017 1:26 pm
Pronouns: he/him

Re: So...how do I use routine class to add a delay to autoscrolling?

Postby FirestarPlays » Sat Apr 17, 2021 6:26 pm

Enjl wrote:
Sat Apr 17, 2021 5:01 pm
Same as how you would have used eventu in the past, just with the word Routine instead of eventu now.
https://wohlsoft.ru/pgewiki/EventU.lua

Example:

Code: Select all

local function myRoutine()
	Routine.waitFrames(64) -- wait 1 second
	Text.showMessageBox("Hello!")
end

function onStart()
	Routine.run(myRoutine)
end
Thank you Enjl! :D

Hoeloe
Phanto
Phanto
Posts: 1465
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: So...how do I use routine class to add a delay to autoscrolling?

Postby Hoeloe » Sun Apr 18, 2021 9:54 pm

Enjl wrote:
Sat Apr 17, 2021 5:01 pm
Routine.waitFrames(64) -- wait 1 second
Just as a note, it's much neater to do:

Code: Select all

Routine.wait(1)
For waiting one second.

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9891
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: So...how do I use routine class to add a delay to autoscrolling?

Postby Emral » Mon Apr 19, 2021 1:27 am

Ah, right, that exists. I prefer going with waitFrames always so that I can tweak the timings on the fly.


Return to “LunaLua Help”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari