Menu Logic Issue

Started by
4 comments, last by Khatharr 10 years, 9 months ago

im trying to figure out the logic to use for my navigation for my application!

im trying to copy the look and feel of the ps3 xmb interface

10280_20090727184148!XMB_of_PS3.jpg

Im just trying to do the X-Axis part of it now!

this is my concept for the x-axis navigation but it fails as of right now!

http://pastebin.com/kXriyJgY

Advertisement

anyone ?????????

Calm down, man. Give people a chance to see it.

I'm looking at it now.

----------------------------------------

What's stopping you from doing this the way you want? You have written in the comment there a suggestion for a better method, but you're not implementing it. I'd actually suggest against using a separate function to calculate the position in this case. It's not complex enough to merit it.

Looking at the switch statements, your base x offset is 116, and it increases inversely to navX in steps of 150.

That is:

base_ox = 166 + ((4 - navX) * 150);

Is that where you're caught?
void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

it dont work like that, all the icon are together and move together,

navX is the current selection on the x axis grid


#include <stdio.h>
#include <stdlib.h>
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
#include "functions.h"
#include "controls.h"

extern SDL_Surface *screen;
extern navX,navY;
SDL_Surface *themeRes[11];



void interfaceTheme(void)
{
	themeRes[0] = IMG_Load("Resource/theme/basic/icon_user.png"); // user icon
	themeRes[1] = IMG_Load("Resource/theme/basic/icon_player.png"); // player/user sub icon
	themeRes[2] = IMG_Load("Resource/theme/basic/icon_newuser.png"); // new user icon
	themeRes[3] = IMG_Load("Resource/theme/basic/icon_music.png"); // main music icon
	themeRes[4] = IMG_Load("Resource/theme/basic/icon_music_album_default.png"); // group music icon
	themeRes[5] = IMG_Load("Resource/theme/basic/icon_music_default.png"); // default song icon
	themeRes[6] = IMG_Load("Resource/theme/basic/icon_usb.png"); // default usb icon
	themeRes[7] = IMG_Load("Resource/theme/basic/icon_network.png"); // default network icon
	themeRes[8] = IMG_Load("Resource/theme/basic/icon_setting.png"); // settings icon
	themeRes[9] = IMG_Load("Resource/theme/basic/icon_update.png"); // update icon
	themeRes[10] = IMG_Load("Resource/theme/basic/icon_poweroff.png"); // poweroff icon
}

void OrbisInterface(void)
{

	SDL_FillRect(screen,NULL,0x000000);

	blit(166 + ((4 - navX) * 150),125,themeRes[0],screen);
	blit(166 + ((4 - navX) * 150),125,themeRes[2],screen);
	blit(166 + ((4 - navX) * 150),125,themeRes[8],screen);
	blit(166 + ((4 - navX) * 150),125,themeRes[7],screen);

	SDL_Flip(screen);

}

sorry figured out blit(166 + ((input - navX) * 150),125,themeRes[0],screen); input was the icon number :) thanks

sorry figured out blit(166 + ((input - navX) * 150),125,themeRes[0],screen); input was the icon number smile.png thanks

Closer... If that works for you then I suppose it's fine.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

This topic is closed to new replies.

Advertisement