Page 1 of 1

Dynamic Panels and State Requirements

PostPosted: Dec 14, 2006 @ 8:29am
by billston

PostPosted: Dec 14, 2006 @ 12:59pm
by Sergio
Hi billston,

I'm afraid to say that the example of the Panel documentation is out of date. Prior to the addition of the Multi state game solution, the onNextFrame method didn't have a panel parameter where to write.
It was not very inefficient to create the panel structure right in there, but it was not certainly the best either. So we changed the onNextFrame method (something we didn't want to do, but have to) and we added the panel as parameter. Thank you for letting us know of this "out of date" example.

About dynamically changing the panels, in the next release we are adding some functionality to do so. You'll be able to resize and move panels on runtime.

About adding event handlers to a panel dynamically: The event handler doesn't keep a copy of its state because we didn't want to add an (in most cases) unnecessary dependency to that class. But as you are creating your own event handlers, extending from the EventHandler class, you can add a parameter to its constructor, or add a method to set and save an instance of a state. Then, you can use that instance to add event handlers in runtime.

Sorry for the long post, here you have a summary:

1- The panel example is out of date. We'll fix it right away
2- In next release (next week) you'll have methods for moving and resizing panels dynamically
3- You can save the state instance in your eventhandler, and use it to add event handlers in runtime.

Best regards,
Sergio.

PostPosted: Dec 14, 2006 @ 5:42pm
by billston

PostPosted: Dec 15, 2006 @ 7:06am
by billston

PostPosted: Dec 15, 2006 @ 4:16pm
by Sergio

PostPosted: Dec 15, 2006 @ 5:45pm
by billston

PostPosted: Dec 16, 2006 @ 12:16am
by Sergio

PostPosted: Dec 16, 2006 @ 3:46am
by billston

PostPosted: Dec 16, 2006 @ 12:21pm
by Sergio

PostPosted: Dec 16, 2006 @ 6:52pm
by billston
Hi Sergio. I absolutely was not offended by anything you said :) It is hard to know a person's development experience and it's different for everyone.

for the record:
My expertise is in J2EE as that has been my day job for the past 5 years. I have ventured into other areas surrounding java from opengl to j2me to a simple reflective persistence framework. I've worked with c# using managed directx and for the origins of this program I'm working on now. I've also dabbled in the odd web scripting here and there. However, I'm very new to c++. I never learned it in school, and up until recently, never had a need to (although I always wanted to). So I'm very eager to learn and I expect there to be different ways of doing things given the flexibility of c++.

Anyway, whatever the case is, I will never claim to know everything. We all have the opportunity to learn from others and it's difficult to communicate most effectively through forum posts. So please know that I do appreciate your efforts to ensure that we understand each other and that I always enjoy discussing strategies. :)

billston

PostPosted: Dec 22, 2006 @ 3:13am
by Sergio
Hi billston,

I'm writting just to let you know that we've released a new version of GledPlay, adding the functionality for changing Panel's size and position.
Also, the bug on drawText method, in Panel class was fixed.

Thank you for your feedback!

Sergio.