Page 1 of 1
0.0.22
Posted: Wed Sep 27, 2017 9:19 pm
by Mr. Kibernetik
Click on #.image will register an action.
Re: 0.0.22
Posted: Thu Sep 28, 2017 3:57 pm
by Mr. Kibernetik
The version is published.
Re: 0.0.22
Posted: Thu Sep 28, 2017 8:18 pm
by rbytes
This is a very useful innovation. Images can now act as buttons.
I made a quick test script. Tap the image to shrink the height by 10 pixels per tap. The image 1.png needs to be in the Resources folder.
Code: Select all
i = #.image
i.source = "resources\1.png"
#.show(i)
i.x = 200
i.y = 200
> i.height, 0..500
#.delay(0.001)
<
>
? #.act(i), i.height -= 10
<
The opening animation is very smooth.
Do I need to have a slowdown in my loops if just waiting for an action?
Re: 0.0.22
Posted: Thu Sep 28, 2017 8:35 pm
by Mr. Kibernetik
rbytes wrote: ↑Thu Sep 28, 2017 8:18 pm
Do I need to have a slowdown in my loops if just waiting for an action?
Maybe some kind of slowing down function will be needed to make program execution less intensive in waiting loops.
Because there is no need to execute, for example, #.act function million times per second as it is going now.
Re: 0.0.22
Posted: Thu Sep 28, 2017 8:43 pm
by rbytes
I usually find a delay of .1 works ok. I don’t always use it if I am in a hurry.
Re: 0.0.22
Posted: Thu Sep 28, 2017 8:47 pm
by Mr. Kibernetik
rbytes wrote: ↑Thu Sep 28, 2017 8:43 pm
I usually find a delay of .1 works ok. I don’t always use it if I am in a hurry.
#.delay is not a slowing down function, because internally #.delay function's code is also running and consuming CPU.
There should be some kind of special function similar to sB's SLOWDOWN command.
Re: 0.0.22
Posted: Thu Sep 28, 2017 8:55 pm
by rbytes
Yes.
Re: 0.0.22
Posted: Fri Sep 29, 2017 9:20 pm
by Mr. Kibernetik
Mr. Kibernetik wrote: ↑Thu Sep 28, 2017 8:47 pm
rbytes wrote: ↑Thu Sep 28, 2017 8:43 pm
I usually find a delay of .1 works ok. I don’t always use it if I am in a hurry.
#.delay is not a slowing down function, because internally #.delay function's code is also running and consuming CPU.
There should be some kind of special function similar to sB's SLOWDOWN command.
Version 0.0.23 will introduce function #.relax which performs this task.
Re: 0.0.22
Posted: Fri Sep 29, 2017 9:29 pm
by rbytes
OK, now I understand what #.relax() is for.