Any way to make it display one image then another and another and loop? Like an animation? I want to make a virtual fireplace.
Any way to make it display one image then another and another and loop? Like an animation? I want to make a virtual fireplace.
Graphics.init()
white = Color.new(255,255,255)
fire_image={} --use arrays (tables) to store animations so that they are far easier to reference
fire_image[0] = Graphics.loadImage(System.currentDirectory().."/fire0.png")
fire_image[1] = Graphics.loadImage(System.currentDirectory().."/fire1.png")
fire_image[2] = Graphics.loadImage(System.currentDirectory().."/fire2.png")
fire_image.frame = 0 --how far through the animation we are
while true do
fire_image.frame = (fire_image.frame + 1) % 3 --modulo equation to keep the frame looping between 0-2
Screen.waitVblankStart()
Graphics.initBlend(TOP_SCREEN)
Graphics.drawImage(0, 0, fire_image[fire_image.frame], white)
Graphics.termBlend()
end
fire_image.spritesheet = Graphics.loadImage(System.currentDirectory().."/firestrip.png")
Graphics.drawPartialImage(0,0, fire_image.frame * 32,0, 32,32, fire_image.spritesheet, white)

I just got thrown the error:
Code:Error: attempt to compare nil with number
Why does this error not have an address?
I located the problem. I was just asking why the error code did not give the location of where the error occurred.Post your code.

I located the problem. I was just asking why the error code did not give the location of where the error occurred.

What is the limit to the size of images that can be loaded in? I try to load in a 1128x94 image I want to partial draw but it simply doesn't show up regardless of whether I use drawImage or drawPartialImage, so I presume it doesn't fit in the pagefile in RAM. The image loads fine when I crop it down to less than 400 pixels wide.
Additionally, when I use the firmware return feature, it returns a long number. I've looked around and I can't seem to find where this number can be referenced against to figure out the public name for the firmware version.
Wow, thanks!Code:Graphics.init() white = Color.new(255,255,255) fire_image={} --use arrays (tables) to store animations so that they are far easier to reference fire_image[0] = Graphics.loadImage(System.currentDirectory().."/fire0.png") fire_image[1] = Graphics.loadImage(System.currentDirectory().."/fire1.png") fire_image[2] = Graphics.loadImage(System.currentDirectory().."/fire2.png") fire_image.frame = 0 --how far through the animation we are while true do fire_image.frame = (fire_image.frame + 1) % 3 --modulo equation to keep the frame looping between 0-2 Screen.waitVblankStart() Graphics.initBlend(TOP_SCREEN) Graphics.drawImage(0, 0, fire_image[fire_image.frame], white) Graphics.termBlend() end
Another way would be to put all the fire images onto one image in a big long strip, load it in,
and then draw a section of it with Graphics.drawPartialImage(), multiplaying fire_image.frame by however wide your sprite is, likeCode:fire_image.spritesheet = Graphics.loadImage(System.currentDirectory().."/firestrip.png")
It would load considerably faster on the game's launch, it's just a tad less legible for human eyes.Code:Graphics.drawPartialImage(0,0, fire_image.frame * 32,0, 32,32, fire_image.spritesheet, white)
There is a 1024x1024 texture limit. And for efficiency you should try to make your texture dimensions powers of 2 (e.g. 64x256 or 512x512 or 128x1024 and such). Even if you shrink your texture to 550x200 it's going to be used in GPU as 1024x256 (next power of 2 dimensions) so might as well take advantage and use that space.What is the limit to the size of images that can be loaded in? I try to load in a 1128x94 image I want to partial draw but it simply doesn't show up regardless of whether I use drawImage or drawPartialImage, so I presume it doesn't fit in the pagefile in RAM. The image loads fine when I crop it down to less than 400 pixels wide.
There is a 1024x1024 texture limit. And for efficiency you should try to make your texture dimensions powers of 2 (e.g. 64x256 or 512x512 or 128x1024 and such). Even if you shrink your texture to 550x200 it's going to be used in GPU as 1024x256 (next power of 2 dimensions) so might as well take advantage and use that space.

If someone is interested in addNotification feature, i pushed a new update to the ctrulib used by lpp-3ds which should add news:s support (so addNotification should work fine also on NH 2.x). Function is currently untested (due to lack of time) but it should work fine.
If someone is interested in addNotification feature, i pushed a new update to the ctrulib used by lpp-3ds which should add news:s support (so addNotification should work fine also on NH 2.x). Function is currently untested (due to lack of time) but it should work fine.
seems to have frozen my system when I tried it though. and nothing was added to Notifications.Cool thanks. I'm programming something that's meta/4th wall as shit so having stuff that interacts with things outside of the program is great.

How do I make the index.lua put inside of the 3dsx like in CHMM?



