Skip to content
gdavid04 edited this page Mar 24, 2017 · 1 revision

Rendering sprites

screen.render(xp, yp, tile, colors, bits);

xp x position of the sprite (a sprite is 8x8)
yp y position of the sprite (a sprite is 8x8)
tile the sprite's position in the spritesheet tile = x + y * 32
colors colors used (see Coloring for more info)
bits
0 - no flip
1 - flip horizontally
2 - flip vertically
3 - flip both

Rendering texts

Font.draw(String msg, Screen screen, int x, int y, int col)

msg the text
screen the screen object (in many cases, you can just use screen or game.screen)
x x position of the text (8 is a sprite's width)
y y position of the text (8 is a sprite's height)
col colors used (see Coloring for more info)

Rendering frames

Font.renderFrame(Screen screen, String title, int x0, int y0, int x1, int y1)

screen the screen object (in many cases, you can just use screen or game.screen)
title the title of the frame
x0 start x
y0 start y
x1 end x
y1 end y

Clone this wiki locally