PicoPicoGameEngine

Quick Links

Screen Object

ppscreen

:viewport()

ppscreen:viewport(x, y, width, height)
ppscreen:viewport({x, y, width, height})
ppscreen:viewport(rect)
rect = ppscreen:viewport()
x : number

y : number

width : number

height : number

rect : rectangle object

:layout()

r = ppscreen:layout({x, y, width, height})
r = ppscreen:layout(rect)
x : number

y : number

width : number

height : number

rect : rectangle object

r : rectangle object

s=ppscreen
g=ppgraph
r=pprect(0,0,320,320)
t={0,0,320,320}
function start()
  local v=s:layout(t)
  s:viewport(v)
  g:fill(0,0,320,320,g.blue)
  s:offset(0,0)
  s:scale(1,1)
  s:viewport(s:size())
  g:box(v)
end

:size()

size = ppscreen:size()
size : rectangle object

:offset()

ppscreen:offset(x,y)
ppscreen:offset({x,y})
ppscreen:offset(pos)
pos = ppscreen:offset()
x : number

y : number

pos : point object

:rotate()

ppscreen:rotate(r)
r = ppscreen:rotate()
r : number

:pivot()

ppscreen:pivot(x,y)
ppscreen:pivot({x,y})
ppscreen:pivot(pivot)
pivot = ppscreen:pivot()
x : number

y : number

pivot : point object

:scale()

ppscreen:scale(x,y)
ppscreen:scale({x,y})
ppscreen:scale(scale)
x : number

y : number

scale : point object

:from()

ppscreen:from(pos)
pos : point object

:to()

ppscreen:to(pos)
pos : point object

base = {0,0,320,320}
function start()
  ppscreen:viewport(
    ppscreen:layout(base))
  ppgraph:fill(base,ppgraph.blue)
  local t = pptouch()
  if #t > 0 then
    p = ppscreen:to(t[1])
    ppgraph:print(
      math.floor(p.x)..","..
      math.floor(p.y))
  end
end

:arrayfrom()

ppscreen:arrayfrom(points)
points : object

point objectの配列

:arrayto()

ppscreen:arrayto(points)
points : object

point objectの配列

base = {0,0,320,320}
function start()
  ppscreen:viewport(
    ppscreen:layout(base))
  ppgraph:fill(base,ppgraph.blue)
  local t = pptouch()
  if #t > 0 then
    p = ppscreen:arrayto(t)
    ppgraph:print(
      math.floor(p[1].x)..","..
      math.floor(p[1].y))
  end
end