Guest User

Untitled

a guest
Apr 24th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1.  
  2. /**
  3. * Created by IntelliJ IDEA.
  4. * User: teamon
  5. * Date: 2009-11-07
  6. * Time: 15:57:46
  7. */
  8.  
  9. import TUIO.TuioObject
  10.  
  11. abstract class WnkObject(tobj: TuioObject) {
  12. var x = calculateX(tobj)
  13. var y = calculateY(tobj)
  14. var angle = tobj.getAngle
  15. var angleDegrees = tobj.getAngleDegrees.toInt
  16. create
  17.  
  18.  
  19. def updateTuioObject(tobj: TuioObject) {
  20. x = calculateX(tobj)
  21. y = calculateY(tobj)
  22. angle = tobj.getAngle
  23. angleDegrees = tobj.getAngleDegrees.toInt
  24. update
  25. }
  26.  
  27. def calculateX(tobj: TuioObject) = (tobj.getX * 1024).toInt
  28. def calculateY(tobj: TuioObject) = (tobj.getY * 768).toInt
  29.  
  30. //
  31. def fxClass
  32. def create {}
  33. def update {}
  34. def destroy {}
  35.  
  36.  
  37. }
  38.  
  39. class SampleObject(tobj: TuioObject) extends WnkObject(tobj) {
  40. override def fxClass = "SampleCircle"
  41. }
Add Comment
Please, Sign In to add comment