create new guicontrol (button) via script?

Started by arj0n, Sat 25/12/2021 23:15:31

Previous topic - Next topic

arj0n

I have a gui that does not contain any guicontrol.
I would like to create a new guicontrol as button via script (without first creating an empty button in the gui editor), is this possible?

Cassiebsg

I don't think it's possible, but I might be wrong.

Is there a reason you don't want to create an empty/hidden button?
There are those who believe that life here began out there...

arj0n

Quote from: Cassiebsg on Sun 26/12/2021 12:52:58
I don't think it's possible, but I might be wrong.

Is there a reason you don't want to create an empty/hidden button?

I'm afraid too it isn't possible.

It's for an arcade/puzzle game.
When loading an existing or custom level, I would like to calculated how many buttons (wall pieces and so on) are needed and create and place them on the grid/board (gui).

Currently i have to create the total amount of buttons possible on the grid. Which would be a max total of 19x16...
This works of course but i would prefer a solution where i can create, via script, just only the amount of buttons needed for the level. That would also drastically reduce the amount of buttons to be created.

Crimson Wizard

#3
AGS does not support creating most of the game objects at runtime*, the only alternate way is to use custom structs and script your own drawing and interaction.


* exceptions are: Overlays, Viewport, Camera and dynamic sprites.

arj0n

Ah, thanx for the info CW.
I'm currently using customs structs and scripts to draw, but was hoping creating gameobjects at runtime was possible. Alas, no problem. Thanx.

Snarky

The ImGi module does something along those lines. (Personally I have found it too limited to be much use in practice, but perhaps it will suit your needs.)

arj0n

Thanx for the heads up, Snarky
I'll look into that module.

SMF spam blocked by CleanTalk