uses consoleG 
 
  BeginScript

  procedure QuadTex(float xp=0.0,yp=0.0,xq=1.0,yq=1.0)
  ====================================================
  'Configured As Front Face
  glBegin GL_TRIANGLE_STRIP
  glNormal3f   0.0 , 0.0  , 1.0
  float u=1.0
  float n=0.0
  glTexCoord2f xp , yp
  glVertex3f -u , -u , n
  glTexCoord2f xq , yp
  glVertex3f  u , -u , n
  glTexCoord2f xp , yq
  glVertex3f -u ,  u , n
  glTexCoord2f xq , yq
  glVertex3f  u ,  u , n
  glEnd
  end procedure


  procedure main()
  ================
  if opening
    'sub LoadTexture(optional string fi, int n,res,*wi,*ht,*pflip)
    '
    texe=5
    static int imgn[]={1,2,3,4,5,6}
    static int wi[6],ht[6]
    LoadTexture  ("..\..\images\star.jpg",imgn[1],0,Wi[1],Ht[1])
    LoadTexture  ("..\..\images\head1.jpg",imgn[2],0,Wi[2],Ht[2])
    LoadTexture  ("..\..\images\mud.jpg",imgn[3],0,Wi[3],Ht[3])
    LoadTexture  ("..\..\images\fruitfly1.jpg",imgn[4],0,Wi[4],Ht[4])
    LoadTexture  ("..\..\images\glass.jpg",imgn[5],0,Wi[5],Ht[5])
    LoadTexture  ("..\..\images\wood1.jpg",imgn[6],0,Wi[6],Ht[6],1) 'flip 90deg
  end if
  cls ' .3,.3,.5
  move 20,-15

  pushstate
  'UserMovement m1,100 'for moveable box
  static MoveableObject m1
  m1.act
  if opening
    m1.id=0x100
    m1.mode=0x101
    m1.s={1.0,1.0,1.0}
  endif
  '
  'display toolbar
  '
  flat
  color 1,.5,.5,.8 'translucent panel
  texture imgn[6]
  scale 1.5
  pushstate
  move 6,0
  scale 9,1.25,1
  quadtex()
  popstate
  move 0,0,.0001
  'separate button icons
  int i
  static int k
  float x=0.015
  for i=1 to 5 'each button
    if picked=200+i
      k=200+i
    endif
    if k=200+i
      color 1,.5,1,.9
    else
      color 1,1,1,.9
    endif
    texture imgn[i]
    picklabel 200+i
    quadtex(0.0,.0.0,1.0,1.0) 'whole images
    texture 0
    move 3,0
  next 'button
  popstate
  '
  end procedure 'main

  EndScript