• Home
  • Products
    • Game Engine
      • Base
      • Mathematics
      • Geometry
      • Physics
      • Particles
      • Animation
      • Graphics
      • Game
      • Game UI
    • Windows Forms
      • Docking Windows
      • Text Editor Control
  • Downloads
  • Buy
    • Overview
    • Professional
    • Indie
    • Non-Commercial
  • Support
    • Overview
    • Blog
    • Forum
    • License FAQ
    • Documentation
  • About
    • About Us
      • Services
    • Contact Us
    • Press
    • Legal Terms
      • Imprint (English)
      • Imprint (German)
Select the search type
 
  • Site
  • Web
Search
DigitalRune.com
Login |Register
NEWS News RSS Feed BLOG Blog RSS Feed FORUM News RSS Feed DOCUMENTATION DigitalRune Software on YouTube DigitalRune Software on Twitter
You are here: SupportForum

If you want to contribute to the forum discussions, please Register or Login.

SearchHome
  • 1
  • 2
  • 3
  • 4
  • 5
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineBest Usage of UIScreenBest Usage of UIScreen
Previous
 
Next
New Post
11/17/2011 2:28 AM
 
Nieldy
No Ranking

Joined: 6/24/2011
Posts: 32
Best Usage of UIScreen 

Hi,

I have a question about usage of the UIScreen class. I have several menu states, and I transition between them when the user clicks on a button or presses a key (e.g. from MainMenu to OptionsMenu). I have some animation that fades the old menu out and the new one in for a transition period. Each menu state has a UIScreen instance, and each UIScreen contains a Window, which contains the menu title, buttons etc. I'm just wondering if there's much difference in efficiency terms in using a UIScreen for each menu state as opposed to using a single UIScreen that contains all of the Windows and just enables and makes visible the ones that are active at the time. In my code, I only load each UIScreen and containing Window once (on the first time the menu state is entered), and keep them around in memory after that. If a screen isn't active, I just set IsEnabled and IsVisible to false.

Does this seem like a reasonable way to go about things, or is there a more efficient way? (e.g. using a single UIScreen)


Thanks for your help. The support at DigitalRune is fantastic by the way compared to most other software companies.


Stephen

 
New Post
11/17/2011 4:34 PM
 
MartinG
7th Level Poster

www.digitalrune.com
Joined: 10/15/2006
Posts: 448
Re: Best Usage of UIScreen 
Nieldy wrote:

Hi,

I have a question about usage of the UIScreen class. I have several menu states, and I transition between them when the user clicks on a button or presses a key (e.g. from MainMenu to OptionsMenu). I have some animation that fades the old menu out and the new one in for a transition period. Each menu state has a UIScreen instance, and each UIScreen contains a Window, which contains the menu title, buttons etc. I'm just wondering if there's much difference in efficiency terms in using a UIScreen for each menu state as opposed to using a single UIScreen that contains all of the Windows and just enables and makes visible the ones that are active at the time. In my code, I only load each UIScreen and containing Window once (on the first time the menu state is entered), and keep them around in memory after that. If a screen isn't active, I just set IsEnabled and IsVisible to false.

Does this seem like a reasonable way to go about things, or is there a more efficient way? (e.g. using a single UIScreen)

Both (using multiple UIScreens or a single, shared UIScreen) are viable approaches. Performance-wise there should not be much of a difference and I actually don't know which is faster. I would have to test and analyse both approaches in a real-world sample.

I recommend that you use the approach that makes the code most readable.

Nieldy wrote:

Thanks for your help. The support at DigitalRune is fantastic by the way compared to most other software companies.

Thanks.

 
New Post
11/20/2011 4:50 AM
 
Nieldy
No Ranking

Joined: 6/24/2011
Posts: 32
Re: Best Usage of UIScreen 

Thanks Martin

 
 Page 1 of 1
Previous
 
Next
HomeHomeDigitalRune Sof...DigitalRune Sof...Game EngineGame EngineBest Usage of UIScreenBest Usage of UIScreen


DigitalRune is a trademark of Garstenauer Information Technology OG.

Garstenauer Information Technology OG
Weingartenstrasse 35, 4452 Ternberg
Austria (EUROPE)
office@digitalrune.com

Home Products Downloads Buy Support About Us
Game Engine Particles Windows Forms Professional Blog Services
Base Animation Docking Windows Indie Forum Contact Us
Mathematics Graphics Text Editor Control Non-Commercial License FAQ Press (News)
Geometry Game Documentation Legal Terms
Physics Game UI Imprint
Impressum
Copyright © 2006-2012 Garstenauer Information Technology OG Terms Of UsePrivacy Statement