Created
June 10, 2016 07:30
-
-
Save paniq/d120eba2cf757c71d3e9ba191fad2c60 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static draggable-button (name id) : | |
void <- (rawstring uint) | |
if (BeginDragSource name id) | |
do | |
; visually remove entry | |
tuple ; | |
do | |
Button name | |
EndDragSource ; | |
static droppable-button (name id) : | |
void <- (rawstring uint) | |
if (BeginDropTarget name id) | |
do | |
Button "DROPPING" | |
Button name | |
do | |
Button name | |
EndDropTarget ; | |
static dragdroppable-button (name id) : | |
void <- (rawstring uint) | |
if (BeginDragSource name id) | |
do | |
; visually remove entry | |
tuple ; | |
do | |
if (BeginDropTarget name id) | |
do | |
Button name | |
vec2 100 100 | |
do | |
Button name | |
vec2 100 0 | |
EndDropTarget ; | |
EndDragSource ; | |
static dragdrop-demo () : | |
void <- () | |
PushID "a" | |
dragdroppable-button "Drag-Drop Me 1" 1 | |
PopID ; | |
PushID "b" | |
dragdroppable-button "Drag-Drop Me 2" 1 | |
PopID ; | |
PushID "c" | |
dragdroppable-button "Drag-Drop Me 3" 1 | |
PopID ; | |
PushID "d" | |
dragdroppable-button "Drag-Drop Me 4" 1 | |
PopID ; | |
do-if (BeginDropHandle) | |
Text "Item ID: %i" | |
GetDropType ; | |
EndDropHandle ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment