sorry to ask a rudimentary question, but i am relatively new to graphics
if i wanted to fill a cylinder type object up one line of pixels at a time:
_
| |
| |
| |
| |
_
(imagine each row is 4 pixels wide or something)
what is the best way to do this?
just make a for loop to drawline one at a time?
simple animation
Moderators: Shine, Insert_witty_name
Here's something that might help. Sorry for the lack of proper explanation, but this code basically eases a menu up, so it goes faster then gradually slows down.
From Concept - The Zulu Version PSP Shell
Might be a little complex for what you want, but yes, if you don't use this, you could use a drawline loop (;
Code: Select all
function ConceptCreate:CloseMenu()
menuopenfull = false
while menuposy < 273 do
screen:clear()
Concept:Render()
Concept:Menu()
screen.waitVblankStart(1)
screen.flip()
if menuposy < 273 then
menuposy = menuposy + 1
if menuposy < 260 then
menuposy = menuposy + 2
if menuposy < 250 then
menuposy = menuposy + 3
if menuposy < 240 then
menuposy = menuposy + 4
if menuposy < 230 then
menuposy = menuposy + 5
if menuposy < 220 then
menuposy = menuposy + 6
end
end
end
end
end
end
end
screen:clear()
Concept:Render()
menuposy = menuposy + 1
screen.waitVblankStart(1)
screen.flip()
end
function ConceptCreate:Render()
Concept:RenderBaseImages()
if menuopenfull == true then
Concept:Menu()
end
end
function ConceptCreate:RenderBaseImages()
screen:blit(0,0,bg)
end
function ConceptCreate:Menu()
screen:blit(menu_viewimagesposx,menuposy + 10,menu_viewimages)
screen:blit(menu_viewmusicposx,menuposy + 20,menu_viewmusic)
screen:blit(menu_viewprogramsposx,menuposy + 30,menu_viewprograms)
screen:blit(menu_explorerposx,menuposy + 40,menu_explorer)
screen:blit(menu_systeminfoposx,menuposy + 50,menu_systeminfo)
screen:blit(menu_utilitiesposx,menuposy + 70,menu_utilities)
screen:blit(menu_closeposx,menuposy + 90,menu_close)
end
Might be a little complex for what you want, but yes, if you don't use this, you could use a drawline loop (;
simplest way would be a for loop with a 4 pixel wide rectangle (instead of 4 lines).
Chaosmachine Studios: High Quality Homebrew.
not really in relation to the preceeding, but i didn't feel like starting a new thread
if i have something like this:
it gives me an error because strpiece isn't a picture. how would i go about assigning the picture names (tjunct, ru, vert, etc) to a variable that lua would output when i do the bottom line, screen:blit ?
if i have something like this:
Code: Select all
if marked[i][j] == 1 then
strpiece = hor
end
if marked[i][j] == 2 then
strpiece = vert
end
if marked[i][j] == 3 then
strpiece = tjunct
end
if marked[i][j] == 4 then
strpiece = ld
end
if marked[i][j] == 5 then
strpiece = lu
end
if marked[i][j] == 6 then
strpiece = rd
end
if marked[i][j] == 7 then
strpiece = ru
end
end
end
screen:blit( 16 * (i - 1) + 236, 16 * (j - 1) + 28, strpiece)
This is a problem I've hit. I fixed it with
Code: Select all
if strpiece == ru then
code
end