'18:32 10/02/2025
'CP  

'#compact
  % filename "t.exe"
 'uses RTL64

  % Title "Console Demo"
 '% Animated
  % ScaleUp
 '% PlaceCentral
 '% AnchorCentral
  uses ConsoleG

  static string PickedName
  '
  macro ShowName(mx)
  ==================
    if bleft
      if picked=mx.id
        move 0,0,.0001
        color .8, .8, 0
        scale 2,0,0
        PickedName=mx.name
        print mx.name
      endif
    endif
  end macro

  sub main
  ========
  '
  if opening then
    CreateTexture imgn,"../../images/Dawn1815.jpg"
  end if
  cls
  pushstate

    pushstate
      UserMovement m1,100,1,"Pie"
      move 5,-6
      color .50,.00,.70,1.0 : fan 5.,000. ,060. ,2.0 'wedge
      color .40,.50,.00,1.0 : fan 5.,060,120,2 'wedge
      color 1,1,0,1
      move .0,.0,.0001
      color .00,.00,.30,.5 : fan 3.,000,360,2 'transp overlay
      thickness 2
      color .90,.20,.00,.5 : arc 5,0,120,1
      ShowName m1
    popstate

    '
    move 0,0,.0002 'next layer
    '
    'FILE IMAGE
    pushstate
      move 11,-18.0
      UserMovement m2,200,1,"Dawn"
      flat
      color 1,1,1,1
      texture imgn
      quadnorm 10.0,10.0*imgnHt/imgnWi 'apply image texture to quad
      texture 0
      move -10,-7
      ShowName m2
    popstate

    move 0,0,.0002 'next layer

    'GRID
    pushstate
      move 11,-18.0
      UserMovement m3,300,1,"Grid"
      thickness 1
      color 1,0,0,0
      color .0,.5,.7,1
      grid 1.,20,10 'fine grid
      thickness 3
      move .0001
      grid 1.,20,10,5,1 'thick grid with pickable overlay
      ShowName m3
    popstate

    move 0,0,.0002 'next layer

    'Display info at top
    pushstate
      move 0,-.5
      scale 2
      'display identity of picked objects m1.id  m2.id  m3.id etc
      if not picked
        Pickedname=""
      end if
      printl "2D Graphics:    object: " + picked + " "+ PickedName
    popstate

  popstate

  'static float ang
  'ang+=.5 : if ang>=360 then ang-=360
  end sub 'main

  EndScript