Closed morganholly closed 1 year ago
Can you please include an example of the code and the spritesheet and what you expect it to look like?
import nico
const orgName = "morgan"
const appName = "factory512"
var buttonDown = false
proc gameInit() =
loadFont(0, "font.png")
loadSpriteSheet(0, "tiles.png", 24, 24)
proc gameUpdate(dt: float32) =
buttonDown = btn(pcA)
proc gameDraw() =
cls()
setColor(if buttonDown: 7 else: 3)
for i in 0..<(384 div 8):
printc("/'\\./'\\./'\\./'\\./'\\./'\\./'\\./'\\./'\\./'\\./'\\./'\\./'\\./'\\./'\\./'\\.", screenWidth div 2, i * 8)
for j in 0..<100:
spr(j, (screenWidth div 2) + 24 * (j mod 10) - 120, (screenHeight div 2) + 24 * (j div 10) - 120)
nico.init(orgName, appName)
nico.createWindow(appName, 384, 384, 2, false)
nico.run(gameInit, gameUpdate, gameDraw)
i would expect it to draw each tile in a grid. changing it to 16x16 didn't fix it so i'm confused
ok if i set the color mode to rgb and reexport it's fixed
The reason it doesn't work is the palette isn't loaded first. You first need to load a palette to specify which colours you're using in your game. Then load your spritesheet, otherwise it will use the default palette.
You can save your palette in the GPL (Gimp Palette Format)
ah that makes sense, thanks
the section at the bottom is two different palettized gradients covering a wide range of colors to test if it had anything to do with the palettization of the spritesheet