well it's p simple:
Buttons are classes that have 3 images and 1 function, it takes the default image, and every time button.draw() is called, it looks at the mouses position, if it is hovering it'll then check if it is down, if it is down it sets itself to be active, else it sets itself to be hovering, else it's default, after that it checks what the last state, and compares it to the current one, if it went from active to hovering (the person let the mouse go ontop of the image), then it calls it's callback.
Text is just text lol.
Windows work like this: it has a list of objects, and to calculate where to put them it's just windowPos + objectPos.
Text input is like a button but the callback is always set some variable to true, and every draw check what buttons are down and append them to the text rendered inside the buttons. then set it in a dictionary to be true, and next draw if the button is down don't add it, but if it isn't then set the dictionary to be false, this prevents it from going like aaaaaaa if you click A once.
Sweet, thanks. I'm gonna do something like this with mine.
EDIT: I was reading back through pages and I saw people suggesting game ideas. I have some fun ones that I can't really make right now so I'll post one here:
A 3D text adventure. The game would look like a first person shooter, but the player would be able to enter text to make the character interact with the world and move them around. It would be very much story driven and the game would know pretty much every verb that exists; this would make the character capable of literally anything. Time would stop while the player entered text, and this would mean the player would be capable of stopping actions.
E.g:
- talk to Monty: character begins conversing with Monty
- pick up teacup: character picks up nearest teacup
- throw teacup at monty: character throws nearest or held teacup at Monty
- put teacup in pocket: character stores teacup in inventory
- jump out of window: character jumps out of window, causing game over if 1+ floor(s) up
- look at ceiling: character view tilts up to show the ceiling, or if player is outdoors, "I'm outdoors."
- go outside: character pathfinds to the front door of the building and leaves
- throw clock out of window: character picks up nearest clock, throws from nearest window.
- stand by plant: character moves to stand by the nearest plant
- examine painting: character looks at nearest painting + "It's a painting. I'm not into art."
- eat burger: character eats nearest burger
- eat Monty: character attempts to eat Monty, causes game over when knocked out by Monty
- go downstairs: character pathfinds to the next floor down in the building
- forget desk: "..."
The game would be open world, the objective would be to solve a crime or something.