MaxGui required?

BlitzMax Forums/BlitzMax Programming/MaxGui required?

Newbie(Posted 2007) [#1]
I have given it some thought. I need to have a number of icons (images) that can be selected, like gadgets, or menu selections etc. I guess i have several options;

first i can read the X/Y and see if the current coordinate is within each item's upper left and lowerright. That approach would work i think ...

on the other hand isn't that what MaxGUI is for? to free the coder from worring about reading each pixel positition?

i guess without MaxGUI i would have something like

pseudo ..
if x not within range
& y not within range
... mouse not over item

etc. for each item


Dreamora(Posted 2007) [#2]
For graphic accelerated gadgets, look for HighGUI 3 by Diablo :D


Newbie(Posted 2007) [#3]
thats a good suggestion, but was i completely off above in regards to not using any plugin or applet? is that how most of you experienced users do? just check the X/Y constantly? I know of Maxgui but never heard of HighGui 3?


ninjarat(Posted 2007) [#4]
That sounds about right, if you were making your own GUI.

But MaxGUI is actually just a wrapper and interface for the system's native GUI. So in Win32 MaxGUI wraps and simplifies Win32GUI, in MacOS it does Cocoa, and in Linux it does FLTK. (FLTK is the only GUI in there not native to the system.)

Also, there are no real differences to the code on any platform, a very nice feature.

And in case you wondered, yes you can create a Max2D graphics context in a MaxGUI window, but it requires a teeny bit more work.


ninjarat(Posted 2007) [#5]
Another good graphic accelerated GUI is FryGUI.


Newbie(Posted 2007) [#6]
Can MaxGui run fullscreen? so if the player wanted Windowed mode he would see the Win32 gadgets etc. but if the player chooses fullscreen its like not using MaxGUI at all?


Dreamora(Posted 2007) [#7]
No, GUI application can due to their nature and their own restrictions, not run fullscreen.

If you want fullscreen, using graphics is the way.
For windowed, either graphics or a Window with a canvas (if it is only a game I think I would prefer graphics here as well)

If you don't need other gadgets, there is no reason you would need maxgui, the events for applications and input are usable without maxgui after all.


Newbie(Posted 2007) [#8]
I am wrapping my beginner brain around this ...
i cant seem to get it to work, the checking within a range for the mouse ...

like as in

(check to see if mouse is over specific area) say X/Y 10,10 W/H 300, 300

if mousex() > 10 and mouseY() > 10
bla bla bla
is a CASE better? it cant be surely?


Newbie(Posted 2007) [#9]
I might be able to use imagecollide() :-)


Dreamora(Posted 2007) [#10]
Yes and if you use a specific layer where only GUI is drawn in you will most likely never need to redraw the collision (draw GUI only with write, but make sure they do not read collision, when checking for which gadget you are in, use rect collision ad mouse position with size 1,1 but do only read collision, not write)


Newbie(Posted 2007) [#11]
Actually Imagecollide() WORKS! the only problem is that they collide when their "edge" touch, not their centre of each one? any ideas for that? But Imagecollide() works fine!


tonyg(Posted 2007) [#12]
Colliderect?
And this might help :



FlameDuck(Posted 2007) [#13]
on the other hand isn't that what MaxGUI is for?
No.

the only problem is that they collide when their "edge" touch, not their centre of each one? any ideas for that?
What tonyg said. Otherwise use a different image for collision checking than the one you actually draw.


siread(Posted 2007) [#14]
I highly recommend FryGUI. Very simple to use and set up screens, and it works like a charm.