This project is read-only.

how to use imageButton

Jul 12, 2008 at 10:23 PM

hello,

first of all, congrats on a great library!

my question is, how can i create a button with a custom image on it. i found the class ImageButton, but dont really know how to use it.

thanks!

Coordinator
Jul 22, 2008 at 11:48 AM
Sorry for the delay!

From a quick glance at the source, it seems that ImageButton currently requires you to specify a rectangle within the skin image for your custom graphic. I probably should make it inherit from Image instead of Icon, to make it easier to add new graphics, but you could do the same thing by applying a custom skin to the ImageButton control, which uses a different skin image from the rest of the GUI controls.

If that doesn't make sense or you need more information/sample code, then let me know. I'll respond quicker next time!

Thanks,
Aaron
Jul 26, 2008 at 10:48 PM

thanks for your reply.

meanwhile i got it running by implementing my own UIComponent.

but here is another suggestion: how about renaming the enum MouseState to MouseCursorState so that it doesnt conflict with the class MouseState from XNA?

thanks for a great library and keep up the good work.

Coordinator
Aug 19, 2008 at 6:03 PM
Thanks for the suggestion, I'll look into it for the next release.
Sep 1, 2008 at 8:23 PM
Hi, Sorry to break in.. Very nice libary, but I wasn't as lucky as the person above.
I just can figure out how ImageButton works, could you be kind to make a source code example showing how to use custom skin on a ImageButton?

Thanks, Lasse.
Coordinator
Sep 8, 2008 at 1:24 PM
I'll take a look at it tonight and hopefully post some code showing how to use it.

Thanks,
Aaron
Sep 23, 2008 at 8:04 PM
Hi.

Have you made an example code?

Lasse.