View previous topic :: View next topic |
Author |
Message |
sjl002 Master Cheater
Reputation: 0
Joined: 31 Aug 2013 Posts: 305
|
Posted: Thu Dec 17, 2015 10:42 pm Post subject: How make moving stars from left to right? |
|
|
Hi Again.
How make lua script for moving stars from left to right?
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Thu Dec 17, 2015 11:34 pm Post subject: |
|
|
You are an odd one, indeed.
Code: | index = 0
spaces = 40
step = 1
values = {}
for i=0,spaces do
local text = "*"
for j=0,i do
text = " " .. text
end
values[i] = text
end
timer=createTimer(nil, false)
timer.Interval=100
timer.OnTimer=function(timer)
if index >= spaces then
step = -1
elseif index <= 0 then
step = 1
end
index = index + step
UDF1.CELabel1.SetCaption(values[index])
end
timer.Enabled=true |
|
|
Back to top |
|
 |
sjl002 Master Cheater
Reputation: 0
Joined: 31 Aug 2013 Posts: 305
|
Posted: Fri Dec 18, 2015 5:42 am Post subject: |
|
|
How slow speed of text.this is very fast?
I want creating animation stars randomize colors.
|
|
Back to top |
|
 |
Zanzer I post too much
Reputation: 126
Joined: 09 Jun 2013 Posts: 3278
|
Posted: Fri Dec 18, 2015 4:46 pm Post subject: |
|
|
Change the Interval to speed up the "animation"
Code: | index = 0
spaces = 40
step = 1
values = {}
for i=0,spaces do
local text = "***"
for j=0,i do
text = " " .. text
end
values[i] = text
end
--timer=createTimer(nil, false)
timer.Interval=100
timer.OnTimer=function(timer)
if index >= spaces then
step = -1
elseif index <= 0 then
step = 1
end
index = index + step
UDF1.CELabel1.SetCaption(values[index])
local color = 0
for i=0,3 do
color = color * 10 + math.random(255)
end
UDF1.CELabel1.Font.Color = color
end
timer.Enabled=true |
|
|
Back to top |
|
 |
sjl002 Master Cheater
Reputation: 0
Joined: 31 Aug 2013 Posts: 305
|
Posted: Mon Dec 21, 2015 6:26 am Post subject: |
|
|
okay , but colors have fast speed , how to down speed of colors.
And , how to make script for create lable in any locations with lua.
and, script for show form.
Thanks.
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Mon Dec 21, 2015 7:36 am Post subject: |
|
|
Maybe spend some time learning LUA?
|
|
Back to top |
|
 |
sjl002 Master Cheater
Reputation: 0
Joined: 31 Aug 2013 Posts: 305
|
Posted: Mon Dec 21, 2015 7:49 am Post subject: |
|
|
from where learn lua?
is hard lua learn?this is very hard?
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Mon Dec 21, 2015 7:53 am Post subject: |
|
|
1. I used Google.
2. After using google for 2 seconds, I found this.
|
|
Back to top |
|
 |
sjl002 Master Cheater
Reputation: 0
Joined: 31 Aug 2013 Posts: 305
|
Posted: Mon Dec 21, 2015 7:58 am Post subject: |
|
|
LUA learning is easy or hard?
|
|
Back to top |
|
 |
++METHOS I post too much
Reputation: 92
Joined: 29 Oct 2010 Posts: 4197
|
Posted: Mon Dec 21, 2015 10:53 am Post subject: |
|
|
Learning is always subjective, isn't it? If you expect to be spoon-fed everything without putting forth any effort, it will be very difficult for you to learn.
|
|
Back to top |
|
 |
|