Advertisement
JoeStrout

TileDisplay hex demo

Mar 29th, 2025
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | Source Code | 0 0
  1. import "chars"
  2. import "stringUtil"
  3.  
  4. clear
  5. display(4).mode = displayMode.tile
  6. td = display(4)
  7. td.tileSet = file.loadImage("/sys/pics/hextiles-55x64.png")
  8. td.tileSetTileSize = [55, 64]
  9. td.cellSize = [55,64]
  10. td.extent = [12,6]
  11. td.overlap = [0, 16]
  12. td.scrollY = -32
  13. td.clear 0
  14.  
  15. text.row = 0
  16. print "Press {left} and {right} to change the offset.".fill(chars), ""
  17.  
  18. while true
  19. text.row = 15; text.column = 10
  20. print "td.oddRowOffset: " + round(td.oddRowOffset, 2) + " "
  21. k = key.get.code
  22. if k == 27 then break
  23. if k == 17 then
  24. td.oddRowOffset -= 0.1
  25. else if k == 18 then
  26. td.oddRowOffset += 0.1
  27. end if
  28. end while
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement