Layout Object

For questions about using Classic.

Post » Fri Jan 09, 2009 8:33 pm

Hello everyone. I've started using Construct recently and I am amazed at how powerful and easy-to-use it is. :)

I've started working on GUI-based project using Construct recently. In this project I rely heavily on RGBA images for window backgrounds which means transparency is really important thing. Since I need to change only specific (and not all) GUI objects (hide one group and display another group) on a single layout I decided to use layout objects (since re-creating complete layout just because few objects are different is painful).

However, layouts cannot have transparent background, or can they? I couldn't find a way to solve this issue. Any idea?

Further, I noticed that when making transition to layout which contains layout object transforms the layout origin near at the center of the screen and remains there even after transition is over. Bug?

Thank you :)
B
2
G
3
Posts: 75
Reputation: 1,000

Post » Sat Jan 10, 2009 1:39 am

The next build has a transparent layout background feature :).
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Sat Jan 10, 2009 6:43 pm

If you just want your GUI to be transparent, (to see the game behind it, correct?) have you tried using layers?
they can go over the top of your game, and be setup so they don't scroll.
B
2
S
1
G
4
Posts: 156
Reputation: 1,612

Post » Sat Jan 10, 2009 11:06 pm

[quote="ansmesnobody":3hielo7o]If you just want your GUI to be transparent, (to see the game behind it, correct?) have you tried using layers?
they can go over the top of your game, and be setup so they don't scroll.[/quote:3hielo7o]

Thanks, that works. :) It's even simpler route. :)

Anyways, just when I thought that Construct is the best development kit I have ever used sudden crash put me down and convinced me that python is really broken. I can't wait to see this feature being fixed in future versions. :D

But now I have to figure out way to code all the simulation logic using event sheets (will be tricky). :? My game requires a lot of dynamic non-visual objects. I guess I can simulate these using invisible sprites and private variables. But how would I write behaviors? How would I map user input with these behaviors?
B
2
G
3
Posts: 75
Reputation: 1,000

Post » Sun Jan 11, 2009 8:48 am

[quote="mirosurabu":1ulc7meh]My game requires a lot of dynamic non-visual objects. I guess I can simulate these using invisible sprites and private variables. But how would I write behaviors? How would I map user input with these behaviors?[/quote:1ulc7meh]

What specifically are you trying to do?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Jan 11, 2009 2:30 pm

Oh, I've just noticed that Function Object which lets you write your own parametric functions. :D And that you can write your own plugins using C++, but not sure if I can use the SDK with MinGW / GCC. Writing plugins can save me a lot of time figuring out how to make required custom widget objects in Construct.

@deadeye:

I am making GUI-based turn-based life sim which puts you in the control of simulated human (actor) of simulated world (virtual world). Virtual world consists of you (the main actor) and number of other computer-controlled actors with whom you can interact. Each actor is made of number of properties which define them, much like characters are made of stats in RPG games. (Properties examples: health, energy, stress levels, skill levels)

It divides gameplay in two phases: "planning phase" and "execution phase". Planning phase is a phase in which you plan your agenda for forthcoming day. You do this by placing activities in your agenda and configuring WHEN they should be performed, HOW LONG they should be performed and using WHAT they should be performed. (Activities are chosen from a given list of available activities at the turn. Activities examples: read book, hang out at the bar, play video games, build body, chat with friend) Once you're done planning your forthcoming day you hit the "execute" button and go to execution phase. This moves you to next layout in which your day is executed (simulated). Your activities are performed (or not, all depending on numerous factors) and your side-interaction with the virtual world. Execution is performed in real-time and the flow of execution cannot be modified by user input any more. You can control the execution speed though. The execution feedback is sent to you (the player) via console messages, much like it's done in simGangster game. Once your day is over, you hit the "Back" button and go to previous "planning phase" layout.

Sorry for this long description, but I just couldn't think of any simpler way to explain the mechanics and what I want to program.

This is how I planned doing this in Construct:

> Use sprites for actor object with "invisible on start" and "Global" options checked. Assign properties using private variables.
> Create actors at the run-time, probably in "Start of layout" event of main menu layout.
> Use array object for keeping agenda entries. Or maybe list object since I'll need more than one value per agenda entry. (remember - when, howlong, what) Make sure that object is global so that I can access it from "execution phase" layout.
> Use function object for activities. One function per activity. Group activity functions. (Grouping events is really nice feature by the way) Each activity accepts following parameters: <who> <what> <when> <howlong> and is executed only for one time-unit. One hour of the day is 4 time-units.
> Clicking the execute button all simulation logic is processed immediately and feedback messages are stored in appropriate array/list object.
> Execution phase layout loops through the object containing feedback messages and displays them on the screen at particular rate

So, I am left with some visual work to do: making widget objects for agenda (list widget where agenda entries are placed), then making the item-list widget where I will display available activities and making that console widget where feedback is displayed. And I am sured I have missed something.

Sorry for this massive off-topic post. :(
B
2
G
3
Posts: 75
Reputation: 1,000

Post » Sun Jan 11, 2009 3:28 pm

[quote="mirosurabu":31ltjgu8]you can write your own plugins using C++, but not sure if I can use the SDK with MinGW / GCC[/quote:31ltjgu8]
You can't use the SDK with GCC or MinGW - I don't think they use the same member-function-pointer binary format (which is how the runtime knows what function to call for actions, conditions and expressions), so it just wouldn't work. Sadly C++ makes no specification about the binary format of these things hence we're stuck.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,580

Post » Sun Jan 11, 2009 5:28 pm

Well, it sounds like you have it pretty well planned out, actually.

And yes, creating your own custom behaviors or objects isn't out of the question, as long as you know how. BROO recently wrote a rather specific object for his game recently... all it does is keep track of Samus Aran's inventory :D

By the way, I really liked Uneksians and I voted for it :). Are you continuing that project at all?
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Sun Jan 11, 2009 7:03 pm

[quote="deadeye":1nvqi87x]Well, it sounds like you have it pretty well planned out, actually.

And yes, creating your own custom behaviors or objects isn't out of the question, as long as you know how. BROO recently wrote a rather specific object for his game recently... all it does is keep track of Samus Aran's inventory :D

By the way, I really liked Uneksians and I voted for it :). Are you continuing that project at all?[/quote:1nvqi87x]

Thanks. :) I'm intending to finish Uneksians but I decided to take some break from platformers. :)

[quote:1nvqi87x]You can't use the SDK with GCC or MinGW - I don't think they use the same member-function-pointer binary format (which is how the runtime knows what function to call for actions, conditions and expressions), so it just wouldn't work. Sadly C++ makes no specification about the binary format of these things hence we're stuck.[/quote:1nvqi87x]

Pity. I hope VC++ Express Edition is adequate alternative?

EDIT: Turns out it isn't. SDK requires ATL. Grrrr.
B
2
G
3
Posts: 75
Reputation: 1,000


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests