![]() |
|
|
|
#1
|
||||
|
||||
|
Ok hey guys I have been working and debugging this for a while now but still cant seem top get it to work. Basically I have a menu setup that looks somewhat like this;
-------------------------- | ICON1 | ICON2 | ICON3 | | ICON4 | ICON5 | ICON6 | -------------------------- and it can also scroll down to all the icons after icon6 but it shows 6 icons on a page at once, then the highlight can go up, down, left, and right. if you press down when highlighting icon4,5,or 6. then it will scroll down making icon1,2, and 3 disappear. if the highlight is on icon3 and pressed right it goes to icon4 without scrolling down, but if it was on icon6 and right was pressed it would scroll down. If it was on icon1 and left was pressed nothing would happen but if you were on icon4 and left was pressed it would go to icon3. another easier way I was thinking about doing was if you pressed right on icon3 it would go to icon1 and if you were on icon1 and pressed down it would stay on the same area as icon1 but icon4 would move up to where icon1 was. Either way is good but i would prefer the first one.. please help my but explaining in depth or posting a script, also if you know PGE and would like to be a full time scripter for this app please tell me because we always need more scripters! ALSO HERE IS MY SCRIPT FOR THE MENU AS OF NOW (FIRST MENU IDEA): Code:
local menu = {
{name = "ICON1", image = ICON1},
{name = "ICON2", image = ICON2},
{name = "ICON3", image = ICON3},
{name = "ICON4", image = ICON4},
{name = "ICON5", image = ICON5},
{name = "ICON6", image = ICON6},
{name = "ICON7", image = ICON7},
{name = "ICON8", image = ICON8},
{name = "ICON9", image = ICON9},
{name = "ICON10", image = ICON10}
}
currentItem = 1
currentHighlight = 1
while pge.running() do
pge.controls.update()
pge.gfx.startdrawing()
pge.gfx.clearscreen()
background1:activate()
background1:draweasy(0, 0)
background1:draweasy(0, 232)
background2:activate()
background2:draweasy(0, 40)
for i = currentItem, math.min(currentItem + 5, #menu) do
menu[i].image:activate()
menu[i].image:draweasy(17 + ((i - (1 + (math.floor((i - 1) / 3) * 3))) * 154), 53 + ((math.floor((i - 1) / 3) - math.floor(currentItem / 3)) * 94))
end
highlight1:activate()
highlight1:draweasy(17 + ((currentHighlight - (1 + (math.floor((currentHighlight - 1) / 3) * 3))) * 154), 53 + (math.floor((currentHighlight - 1) / 3) * 94))
verdana10:activate()
verdana10:printcenter(240, white, "Temporary (testing): " .. menu[currentItem].name)
verdana10:printcenter(250, white, "For More Information Contact mediagrab@yahoo.com")
if pge.controls.pressed(PGE_CTRL_UP) then
if currentItem - 3 >= 1 then
currentItem = currentItem - 3
end
elseif pge.controls.pressed(PGE_CTRL_DOWN) then
if currentItem + 3 < #menu then
currentItem = currentItem + 3
end
elseif pge.controls.pressed(PGE_CTRL_LEFT) then
if currentHighlight < 1 then
currentHighlight = 1
else
currentHighlight = currentHighlight - 1
if currentItem - 3 >= 1 and currentHighlight == 1 or currentHighlight == 4 then
currentItem = currentItem - 3
end
end
elseif pge.controls.pressed(PGE_CTRL_RIGHT) then
if currentHighlight >= 6 then
currentHighlight = 4
if currentItem + 3 < #menu then
currentItem = currentItem + 3
end
else
currentHighlight = currentHighlight + 1
if currentHighlight > #menu then
currentHighlight = #menu
end
end
elseif pge.controls.pressed(PGE_CTRL_CROSS) then
if ((currentItem - 1) + currentHighlight) == 1 then
-- do something
elseif ((currentItem - 1) + currentHighlight) == 2 then
-- do something
elseif ((currentItem - 1) + currentHighlight) == 3 then
-- do something
elseif ((currentItem - 1) + currentHighlight) == 4 then
-- do something
elseif ((currentItem - 1) + currentHighlight) == 5 then
-- do something
elseif ((currentItem - 1) + currentHighlight) == 6 then
-- do something
elseif ((currentItem - 1) + currentHighlight) == 7 then
-- do something
elseif ((currentItem - 1) + currentHighlight) == 8 then
-- do something
elseif ((currentItem - 1) + currentHighlight) == 9 then
-- do something
elseif ((currentItem - 1) + currentHighlight) == 10 then
-- do something
end
end
pge.gfx.enddrawing()
pge.gfx.swapbuffers()
end
elseif states.current == states.quit then
break
else
error("A fatal error has occoured within the states system.")
end
pge.gfx.enddrawing()
pge.gfx.swapbuffers()
end
|
|
#2
|
|||
|
|||
|
ive been workin on the pge menu so ill help
(need ur eboot n other files, kinda touching my PGE menu up )
Last edited by 04005003; 10-11-2009 at 05:17 PM. Reason: n/a |
![]() |
| Tags |
| help pge menu |
|
|
|||
|
|||
|
|
| Thread Tools | |
| Display Modes | |
|
|