Skip to content

Instantly share code, notes, and snippets.

@greggirwin
Created June 26, 2016 14:19
Show Gist options
  • Save greggirwin/8f77618ec8d33e1cf90a7f25fc9ecb38 to your computer and use it in GitHub Desktop.
Save greggirwin/8f77618ec8d33e1cf90a7f25fc9ecb38 to your computer and use it in GitHub Desktop.
Show how easy it is to move a face dynamically in Red layout.
Red [
Title: "Move a face"
Author: "Gregg Irwin"
File: %move-face.red
Tabs: 4
Needs: View
Purpose: {Show how just changing a face's offset moves it.}
]
diff: 1
view [
size 200x200
origin 0x0
button "Quit" 50x50 rate 30 [quit] on-time [
face/offset: face/offset + diff
if face/offset < 0 [diff: 1]
if face/offset > 150x150 [diff: -1]
]
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment