B4A Library [B4X] [XUI] SD_Dice

dado.gif
ezgif.com-crop.gif



SD_Dice

Author:
Star-Dust
Version: 1.04
  • DiceView
    • Events:
      • Click
      • CompleteRoll
    • Fields:
      • mBase As B4XView
      • Tag As Object
      • TimeMovment As Int
    • Functions:
      • Class_Globals As String
      • DesignerCreateView (Base As Object, Lbl As Label, PropS As Map) As String
        Base type must be Object
      • Initialize (Callback As Object, EventName As String) As String
      • IsInitialized As Boolean
        Verifica se l'oggetto sia stato inizializzato.
      • Move (X As Int, Y As Int, Z As Int) As String
      • RollTo (FaceNumber As Int)
      • Rotate (DegreeX As Int, DegreeY As Int, DegreeZ As Int) As String

Here for B4J
Here for B4i
 

Attachments

  • Sample - B4a.zip
    91.7 KB · Views: 344
  • SD_Dice 1.04.zip
    18.5 KB · Views: 345
  • iSD_Dice 1.04.zip
    264.7 KB · Views: 222
  • jSD_Dice 1.04.zip
    18.7 KB · Views: 247
  • sample - b4i.zip
    424.9 KB · Views: 229
  • Sample - B4j.zip
    2.2 KB · Views: 245
Last edited:

JohnC

Expert
Licensed User
Longtime User
OK, so first part of problem now solved - I can control the dice on my phone.

Second part - todo - control the dice on the casino's table.
 

Star-Dust

Expert
Licensed User
Longtime User
Update rel 1.01
  • Add RollTo(FaceNumber)

Allows you to roll the data until it reaches a face
B4X:
DiceView1.RollTo(RND(1,7))
Video 2.gif
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Update rel 1.02
  • Improved rotation. Ability to change the timing of the animation

Trick to turn the nut to the desired face
Code:
Sub ChangeFace(FaceNumber As B4XFont)
    Select FaceNumber
        Case 1
            DiceView1.Rotate(0,10,0)
        Case 2
            DiceView1.Rotate(0,280,0)
        Case 3
            DiceView1.Rotate(90,10,0)
        Case 4
            DiceView1.Rotate(270,10,0)
        Case 5
            DiceView1.Rotate(0,100,0)
        Case 6
            DiceView1.Rotate(0,190,0)
    End Select
End Sub
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
thanke you for your nice library. could you tell me more how can we change dice image?
It is not possible to do this. It is a traditional dice
 
Top