Homebrew LPP Breaks When I Try to Show an Image

BringusStudios

Well-Known Member
Member
Joined
Oct 3, 2011
Messages
442
Reaction score
231
Trophies
1
Age
27
Website
bringus.studio
XP
643
Country
United States
I'm not really sure what's up with this. Do the .png files need to be in some special format, or am I just doing this wrong?

EDIT: "/assets/question.png" is supposed to be "/question.png" in index.lua.
 

Attachments

Last edited by BringusStudios,
Maybe position it like this?
Code:
question = Screen.loadImage("/assets/question.png")
while true do
   Screen.waitVblankStart()
   Screen.refresh()
   Screen.drawImage(400,240,question,TOP_SCREEN)
   Screen.debugPrint(0,0,"Press B to exit",Color.new(255,255,255),BOTTOM_SCREEN)
   Screen.flip()
 
Nope, still black screen. My text isn't even showing up.

You have a few different problems in your code. I didn't run this since I'm not on the right computer but give this a shot :)

Code:
question = Screen.loadImage(System.currentDirectory().."/assets/question.png")

while true do
  Screen.waitVblankStart()
  Screen.refresh()

   Screen.drawImage(0,0,question,TOP_SCREEN) -- you want the coordinates to the start x position and the start y position. 0,0 would be the top left corner of the screen
   Screen.debugPrint(0,0,"Press B to exit",Color.new(255,255,255),BOTTOM_SCREEN)

  if Controls.check(Controls.read(),KEY_B) then
  System.exit()
  end

   Screen.flip()
end
 
Last edited by keanutah,
Nope and nope... If someone wants to just make a code from scratch that does nothing but display a png I can go off of that.
Code:
img = Screen.loadImage(imageLocation)
while true do
    Screen.waitVblankStart()
    Screen.refresh()
    Screen.clear(TOP_SCREEN)
    --Screen.clear(BOTTOM_SCREEN) <-- if necessary
    Screen.drawImage(0, 0, img, TOP_SCREEN)
    Screen.flip()
end

edit: ehh shit clean() is actually clear()
 
Last edited by 730,
Have you tried using any of the example lua files that are provided with the download?
Yeah but the image one doesn't include "file.bmp"

--------------------- MERGED ---------------------------

Code:
img = Screen.loadImage(imageLocation)
while true do
    Screen.waitVblankStart()
    Screen.refresh()
    Screen.clear(TOP_SCREEN)
    --Screen.clear(BOTTOM_SCREEN) <-- if necessary
    Screen.drawImage(0, 0, img, TOP_SCREEN)
    Screen.flip()
end

edit: ehh shit clean() is actually clear()
Nope... this is driving me crazy!
 
Yeah but the image one doesn't include "file.bmp"

--------------------- MERGED ---------------------------


Nope... this is driving me crazy!
You are clearly doing something very wrong, most likely your image placement.
 
Can you make a .zip file of everything EXACTLY coded and placed correctly?
Not at home right now. All you should know is that when loading the image, "/img.png" would try to load img.png from the root. System.currentDirectory() returns the directory where the 3dsx is located, therefore System.currentDirectory() .. "/img.png" ends up loading "3ds/<homebrew>/img.png".
Also is your script named "index.lua" and placed next to the lpp 3dsx?
 
So all I did was take the code I placed above and move your question.png into an /assets folder. Works fine in Citra.
This works perfectly. I know the picture was misplaced in the code, the .zip was missing the assets folder, but the one I was testing was ordered just like this... Oh well, thanks for getting it to work!
 

Site & Scene News

Popular threads in this forum