PicoPicoGameEngine

Quick Links

Source Code

s=ppscreen
g=ppgraph

B0=s:size()

B1=pprect(0,0,320,480)

B2=pprect(0,0,200,260)

B3=pprect(0,0,140,100)

function drawinfo(t,c)
  g:fill(t,c)
  g:pos(0,0)
  local w,h
  w=t.width
  h=t.height
  g:print(w.."x"..h)
end

o=ppoffscreen.new()
o:create(32,32)
o:fill(o:size(),g.cyan)

o1=o

o=ppoffscreen.new()
o:create(32,32)
o:fill(o:size(),g.yellow)

o2=o

o=ppoffscreen.new()
o:create(32,32)
o:fill(o:size(),g.orange)

o3=o

t=g:layout(
  o:size(),true,true,B3)
o:pos(t)

function start()

  t=s:layout(B0)
  s:viewport(t)
  drawinfo(B0,g.gray)

  t=s:layout(B1)
  s:viewport(t)
  drawinfo(B1,g.blue)

  t=s:arrayto(pptouch())
  o1:drag(t,B1)
  o1:draw()

  t=s:layout(B2)
  s:viewport(t)
  drawinfo(B2,g.green)

  t=s:arrayto(pptouch())
  o2:drag(t,B2)
  o2:draw()

  t=s:layout(B3)
  s:viewport(t)
  drawinfo(B3,g.red)

  t=s:arrayto(pptouch())
  o3:drag(t,B3)
  o3:draw()

end