Android Question Throwing playing cards

TILogistic

Expert
Licensed User
Longtime User
Is this what you want?

Example created for B4X (B4A, B4J, B4i)

1.gif
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Does anyone have a routine that simulates a dealer throw cards at a specific player on a poker table?
If you want to update or improve it, here it is.
And apologies for the variable and function names being in Spanish.
The cards can be images or font icons.
The key to the animations lies in these main variables.
B4X:
    ' DESTINATION
    ' The cards are dealt horizontally.
    Dim Separacion As Float = 62dip
    Dim AnchoMano As Float = pnlManoJugador.Width
    Dim CentroMano As Float = pnlManoJugador.Left + AnchoMano / 2
    Dim Total As Int = ManoJugador.Size
    Dim Offset As Float = (PosicionMano - (Total - 1) / 2) * Separacion
    Dim DestinoX As Float = CentroMano - CartaW / 2 + Offset
    Dim DestinoY As Float = pnlManoJugador.Top + 5dip
  
    ' Flight parameters
    Dim Duracion As Int = 650
    Dim Pasos As Int = 40
    Dim Altura As Float = 200
  
    ' Initial size
    Dim EscalaInicial As Float = 0.70

NOTE:
And greetings to my friend @LucaMs, from Chile.
I didn't have time to turn it into a class, but I hope someone creates one.
 

Attachments

  • B4XCrupier.zip
    5.5 KB · Views: 18
Last edited:
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
And apologies for the variable and function names being in Spanish.
Google translator 😁:
B4X:
' DESTINATION
'The cards are distributed horizontally.
Dim Separation As Float = 62dip
Dim HandWidth As Float = pnlPlayerHand.Width
Dim HandCenter As Float = pnlPlayerHand.Left + HandWidth / 2
Dim Total As Int = PlayerHand.Size
Dim Offset As Float = (HandPosition - (Total - 1) / 2) * Separation
Dim DestinationX As Float = HandCenter - CardW / 2 + Offset
Dim DestinationY Ace Float = pnlPlayerHand.Top + 5dip

' Flight parameters
Dim Duration As Int = 650
Dim Steps As Int = 40
Dim Height As Float = 200

'Initial size
Dim InitialScale As Float = 0.70
 
Upvote 0
Top