Announcement

Collapse
No announcement yet.

spinning numbers (slots)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • spinning numbers (slots)

    Hi!
    Is there a way to make spin numbers 5-10sec?
    My friend asked me to make "lotto" for his business
    I got help with one but it's to fast, clicking and number appears in inputs...
    Need to make it more like casino slots between 001-999 three inputs...
    Code:
    local tLine = {};
    while #tLine < 3 do
        local nNum = string.format("%02d", Math.Random(1, 999));
        while Table.Find(tLine, 1, nNum, false) ~= nil do
            nNum = string.format("%02d", Math.Random(1, 999));
        end
        --
        tLine[#tLine+1] = nNum;
    end
    tAllLines[#tAllLines+1] = tLine;
    Input.SetText("Num1", string.format("%s", tLine[1]));
    Input.SetText("Num2", string.format("%s", tLine[2]));
    Input.SetText("Num3", string.format("%s", tLine[3]));
    
    -- 
    local tLines = {};
    for x, y in ipairs(tAllLines) do
        tLines[#tLines+1] = string.format("%s", table.concat(y, ", ", 1, #y));
    end
    Input.SetText("Input2", table.concat(tLines, "\r\n", 1, #tLines));

  • #2
    I am not sure if this is exactly what you want, but it should give you a good start:

    Click image for larger version

Name:	SCRN-2015-09-09-02.png
Views:	1
Size:	7.8 KB
ID:	284342

    This sample shows three counters. Each counter features all numbers between 000 and 999, positioned in a random order, which is changed each time the program is started. When you click the button, the numbers will spin and move for a certain number of positions. Each counter has its own timer, so each of them can have a separate speed, hence the disalignment of the numbers in the screen capture above.

    This project uses only one image - the numbers are actually Label objects, so the project is very small. Once you understood how it works, you should have no problems modifying it to fit your needs, and correct any errors you may find.

    Ulrich

    Comment


    • #3
      yes! this is the stuff...
      thanks!

      Comment

      Working...
      X