|
#1
|
|||
|
|||
|
Hello when I start my programm the screen still black and the picture doesn't appear. What's the problem?
code: height = screen.height() width= screen.width() black = color.new(0,0,0) screen.fillrect(0,0,width,height,black) screen.update() image.setresource("Pic.bin") PlateauAll = image.load("Pic/PlateauAll.png") PlateauAll:draw(0,0,widht,height) screen.update() while 1 do if control.isButton() == 1 then PlateauAll:close() break end os.sleep(10) end |
|
|
|||
|
|
|
#2
|
|||
|
|||
|
PlateauAll:draw(0,0,widht,height)
spelling error if that does not help, try not to use .bin extension. name a folder to "pic" instead |
|
#3
|
|||
|
|||
|
sorry but i don't see the spelling error
As regards bin i must say image.setresource("Pic"). Is that it? thx |
|
#4
|
|||
|
|||
|
im not sure how to successfully use .bin for picture containers.
if u use a folder to store the images, then there is no need to set resources. height = screen.height() width= screen.width() black = color.new(0,0,0) screen.fillrect(0,0,width,height,black) screen.update() --image.setresource("Pic.bin") PlateauAll = image.load("Pic/PlateauAll.png") PlateauAll:draw(0,0,width,height) screen.update() while 1 do if control.read()==1 then if (control.isButton() == 1) then break end else os.sleep(10) end end PlateauAll:close() Last edited by JJLoke; 03-04-2010 at 08:06 AM. |
|
#5
|
|||
|
|||
|
i delete the set ressource and then the problem still exist
but i try to modify x,y and it works so i put again x,y for full screen and it works I don't understand but i used to have a problemthx |
|
#6
|
|||
|
|||
|
I've got another question.
Sometimes i've got '<eof>' expected near 'end' What does it mean? thx |
|
#7
|
||||
|
||||
|
The lua interpreter expects the end of the file (eof) where it sees the 'end'.
That means, you've got an additional 'end' which is not necessary and has to be removed. E.g.: Code:
if something() then
doSomething()
end
end -- error
|
|
#8
|
||||
|
||||
|
Quote:
Quote:
PlateauAll:draw(0,0,widht,height) instead of PlateauAll:draw(0,0,width,height) You see the difference in the spelling of "width" ? I also make that mistake a lot, "phkey" instead of "hpkey" and then I'm wondering why it doesn't work
|
|
#9
|
|||
|
|||
|
thank you Brett_val and xConStruct for all
bye |
|
#10
|
||||
|
||||
|
Haha I just had it again..
"why does it give me errors..?" *puts "print()" everywhere* "why does it print 'nil' everytime...?" and after close inspection, I typed "lenght" somewhere instead of "length" :P |
|
#11
|
|||
|
|||
|
Dyslexia ftw!
__________________
Only ONE more functions in the Wiki need addressing! Zen X-Fi2 LUA Wiki Want to protect your applications? Click Here! Tower Defense Thread Zen Lock - Protect Your Zen! |
|
#12
|
|||
|
|||
|
tts strange ... i posted a working code in my post but he seems to missed it
|
|
#13
|
|||
|
|||
|
Hi everyone !
I start to create a "software", but I have a problem ( an important problem ! lol ). I don' t know how to show a picture on the screen T.T One day I tried in a game for PSP, but I don' t know, I can' t do that on ZEN -_-" ... So if someone could tell me the code to show a picture on ZEN, tell me please .I think it' s not important, but the picture I want to show is the background of the application. I just started like that : Code:
-- Images
image_bg = image.load:("images/background.png");
Please help me ^^ If a topic already exist about that I' m sorry but I didn' t find it :/ Thank you for all, Bye .
|
|
#14
|
||||
|
||||
|
There have been other people asking about this, I'll merge this into a thread I remember about this. There's only two pages of threads so far, it shouldn't take long to go through both to see if there is a similar topic (I just did).
Also the answer is that you first load your picture as you did (without the : ), then you have to draw it to the screen. But to see the image you have to catch it in a loop also, otherwise it'll exit the program instantly: Code:
image_bg = image.load("images/background.png")
width = screen.width() --Saves screen width
height = screen.height() --Saves screen height
image_bg:draw(0,0,width,height)
screen.update()
while(true) do --eternal loop
if(control.read() == 1 and control.isTouch() == 1) then --if the screen is touched
break --break the loop
end
end
image_bg:close()
__________________
"If you are good enough at English to apologize, then there is no need to." - A good friend of mine Discovered something about the X-Fi2 you think others may not know? Post it here so others can learn about it! Have a question about X-Fi2 apps? Consult the FAQ before creating a thread about it. Like my work? Tell your friends. Don't like it? Tell me so I can improve. ^.^ Last edited by Habhome; 04-22-2010 at 02:55 PM. |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 05:20 PM.












but i used to have a problem
.
.
Linear Mode
