SHARE
TWEET

Helvetica Clock in Tao3D, packed version

a guest Nov 6th, 2014 178 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Animate
  2. background_color "black"
  3. color "white"
  4. rotate_x -180*mouse_y/window_height
  5. rotate_y 180*mouse_x/window_width
  6. font "Arial",300
  7. align 0.5
  8. align_vertically 0.5
  9. once
  10.   H:=1.1*text_height "0"
  11.   W:=1.1*text_width "0"
  12. locally
  13.   Idx:=0
  14.   translate_x -2.5*W
  15.   two_digits with hours,minutes,seconds
  16. blend_function "DST_COLOR","ONE_MINUS_SRC_ALPHA"
  17. color_hsv 2*time,0.3,0.5,0.7
  18. rectangle 0,0,6.5*W,H
  19. two_digits N:integer->digit_column with N/10,N mod 10
  20. digit_column N:integer->
  21.   locally
  22.     adjust -N*H,curY[Idx]
  23.     digit with 0..9
  24.   translate_x W
  25.   Idx:=Idx+1
  26. digit N:integer->
  27.   text_box 0,0,2*W,2*H,
  28.     render N
  29.   translate_y H
  30. adjust TY:real,Y:real->
  31.   interpolate 0.1,TY,Y
  32.   translate_y Y
  33. adjust TY:real,Other->
  34.   curY[Idx]:=TY
  35.   adjust TY,curY[Idx}
  36. H->15.0
  37. W->15.0
  38. Idx->0
  39. data curY
RAW Paste Data
Top