Making images, buttons and backgrounds

In need of a nice glossy button? A background, a circular text on a marble texture?

Just found this site: http://www.grsites.com/

where you can easily generate all you need for a game…

lots of choices with examples readily available…

just made this button: (it even comes with a mouse_over highlight)

so we just need a nice struct for an image and a struct which extends this struct to a button struct 🙂

for example:

typedef struct{

char* imageTitle; // a string

u16* imageArrayBin; // pointer to the image_bin

u8 posX;

u8 posY;

u8 width;

u8 height;

} ImageView;

…..and…..

typedef struct{

ImageView* imageView;//pointer to the image of your button

u8 posX;

u8 posY;

FunctionPointer* buttonPushed;

} ButtonView;

oh yes, what was all that about pointers to functions????

It is just an easy way to implement what to do when the button is pushed…

look here: http://www.cprogramming.com/tutorial/function-pointers.html

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: