PicoPicoGameEngine

Quick Links

Texture Object

pptex

:load()

texture = pptex:load(name,[texture option])
texture : texture object

{
  index=[],
  name=[],
  size=[],
  imageSize=[]
}

name : string

[texture option] : object

{
  linear=[Bilinear filter flag],
  wrap_s=[edge type string],
  wrap_t=[edge type string]
}

These are edge type strings.

  • linear
  • repeat
  • clamp_to_edge

See OpenGL GL_CLAMP_TO_EDGE, GL_LINEAR and GL_REPEAT.

g=ppgraph
tex=pptex:load("characters.png")
function start()
  g:put(0,0,2,tex)
  g:locate(0,32)
  g:print(
    "index="..tex.index)
  g:move(0,16)
  g:print(
    "name="..tex.name)
  g:move(0,16)
  g:print(
    "width="..tex.size.width..
    ",height="..tex.size.height)
  g:move(0,16)
end

:delete()

pptex:delete(texture)
texture : texture object

:default()

pptex:default(texture)
texture = pptex:default()
texture : texture object

:count()

count = pptex:count()
count : number

:textures()

texture_list = pptex:textures()
texture_list : object

pptex:load("characters.png")
pptex:load("sample.png")
ppfont:set("half")
function start()
  local t = pptex:textures()
  for k,v in pairs(t) do
    ppgraph:print(
      k..","..v.name)
    ppgraph:move(0,16)
  end
end