Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline bfox  
#1 Posted : Friday, January 6, 2012 2:56:12 PM(UTC)
bfox

Joined: 8/22/2011(UTC)
Posts: 170
Location: Moscow

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
I understand how to solve the problem. Thanks for the tips and helpThumpUp

Edited by user Saturday, January 7, 2012 2:12:36 PM(UTC)  | Reason: Not specified

Russian game developer.
Давайте делать игры в команде. Идет набор.

Wanna join the discussion?! Login to your forum accountregister a new account. Or Connect via Facebook Twitter Google

Offline Benjamin  
#2 Posted : Friday, January 6, 2012 8:16:36 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
I really don't think this is a memory leak. You are creating a new scene every second frame and this obviously creates a lot of data when you have thousands of frames per second. There is no need to free memory if your system has enough. Use a .NET memory profiler to find out if there are really memory leaks, the Task Manager won't help you much.

I don't know what you mean by "I tried to use Screen, Scenes,Scene.Open(...), and other,But the true result is not found..."? What are you trying to accomplish? In your last sample you never set Testbool to false?
Offline bfox  
#3 Posted : Friday, January 6, 2012 8:28:51 PM(UTC)
bfox

Joined: 8/22/2011(UTC)
Posts: 170
Location: Moscow

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: Benjamin Nitschke (DeltaEngine) Go to Quoted Post
I really don't think this is a memory leak. You are creating a new scene every second frame and this obviously creates a lot of data when you have thousands of frames per second. There is no need to free memory if your system has enough. Use a .NET memory profiler to find out if there are really memory leaks, the Task Manager won't help you much.

I don't know what you mean by "I tried to use Screen, Scenes,Scene.Open(...), and other,But the true result is not found..."? What are you trying to accomplish? In your last sample you never set Testbool to false?

I want to understand how to change the 2 screens in one scene. I can open screen 1 then open screen 2. after that i want open screen 1 but how ? if i close screen i'll take
01.316 Warning: The closing screen 'Screen (Name=<FreeScreen>, Type=UIScreen)' was not attached to any scene.

Edited by user Friday, January 6, 2012 8:35:11 PM(UTC)  | Reason: Not specified

Russian game developer.
Давайте делать игры в команде. Идет набор.
Offline Benjamin  
#4 Posted : Friday, January 6, 2012 8:49:56 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Generally you would just create a Scene like any other content object with "new Scene(...)", the same goes for screens. Currently screens are not available via content and must be created programatically. Because of that you need to attach a screen to a scene yourself via the Open method. The Open method will attach the screen to the current scene.

There is no problem in attaching multiple screens to a scene and that is also highly common (e.g. in a main menu scene you would have many screens for overlays, options, credits, etc.). I have not used scenes much, maybe Enrico (Judge) who developed all this can jump in and tell us what to do best in the current state (keep in mind the UI system is not in a complete state right now). I suggest hiding screens (via "screen.State = ScreenState.Hidden;") you currently don't want to show or just don't open them.

Normally you should have a stack of screens, which you open and close one by one as you navigate through them, e.g.:

  • Main Menu Background
    [**] Main Menu Overlay
    [***] Singleplayer
    [***] Options
    [***] Credits


When you are in credits Main Menu Background and Overlay is on and on top Credits is displayed (or you close Main Menu Overlay or even everything, depends on your game). When you go back you just close the current scene and you are back where you started (or alternatively you re-open a closed screen or un-hide it, but I am not sure what the best approach here would be, a bit of trial and error is probably needed).
Offline bfox  
#5 Posted : Friday, January 6, 2012 8:59:37 PM(UTC)
bfox

Joined: 8/22/2011(UTC)
Posts: 170
Location: Moscow

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
screen.State ?
havent property State
http://help.deltaengine....serInterfaces_Screen.htm

This is what I need, but I do not understand where the State.

Edited by user Friday, January 6, 2012 9:01:41 PM(UTC)  | Reason: Not specified

Russian game developer.
Давайте делать игры в команде. Идет набор.
Offline Benjamin  
#6 Posted : Friday, January 6, 2012 9:11:18 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Hmm, it is not visible because it is internal. You can access it in the Delta.Scenes.Tests assembly however (because it is a friend assembly of Delta.Scenes). It is probably not a good idea to set it directly as the Scene should open and close screens and manage which ones are visible.

Can you maybe post a complete example what you are actually trying to do and then we can figure out the best way how to do it. It is probably best if you just do it the way described in the Delta.Scenes.Tests.UIScreenTests class (like in your first post). If you get an error or warning we might figure it out as well or see a bug that needs fixing. Our game teams have build very complex UIs with this system however and found ways to solve all problems as well.
Offline bfox  
#7 Posted : Friday, January 6, 2012 10:03:30 PM(UTC)
bfox

Joined: 8/22/2011(UTC)
Posts: 170
Location: Moscow

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Code:
		[Test, Category("Visual")]
		public static void Test()
		{
			// Create a UI screen (with starting a new scene)
			Screen mainScreen = new Screen("<TestScreen>")
			{
				// and set the background we want to see
				Background = new Material2DColored(Color.Red),
                
			};

			mainScreen.Open();
            
            Font infoFont = Font.Default;

			Application.Start(delegate
			{

                infoFont.DrawCentered(mainScreen.State.ToString(),new Point(0.5f,0.5f) );
                if (Input.Keyboard.IsReleased(InputButton.W))
                {
                    mainScreen.State = ScreenState.Hidden;
                }
                if (Input.Keyboard.IsReleased(InputButton.S))
                {
                     mainScreen.State = ScreenState.Active;
                }
			});
		}

How Active? if i mainScreen.State = ScreenState.Active; state == Active, but screen invisible


And i add link in my sample game to Delta.Scenes.Tests;
I add [assembly: InternalsVisibleTo("Delta.Scenes.Tests")] in AssemblyInfo.cs and nothing

see screenshot how to access to inetrnal in other namespace


I do not understand How i can hide the screen in the gameBored

Edited by user Friday, January 6, 2012 11:22:11 PM(UTC)  | Reason: Not specified

bfox attached the following image(s):
test.png (112kb) downloaded 14 time(s).

You cannot view/download attachments. Try to login or register.
Russian game developer.
Давайте делать игры в команде. Идет набор.
Offline bfox  
#8 Posted : Saturday, January 7, 2012 12:41:48 PM(UTC)
bfox

Joined: 8/22/2011(UTC)
Posts: 170
Location: Moscow

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Why I did not see newChild in UserInterfaces...Angry
Now I understand how to make interfaces ThumpUp
Scenes and screens are not needed.

Edited by user Saturday, January 7, 2012 2:10:32 PM(UTC)  | Reason: Not specified

Russian game developer.
Давайте делать игры в команде. Идет набор.
Offline Benjamin  
#9 Posted : Saturday, January 7, 2012 2:38:12 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
If you cannot access internals of Delta.Scenes in Delta.Scenes.Tests then probably the obfuscation of the public repository has a bug and causes it to not work anymore. But as I said before it is probably not the best solution anyway.

Hopefully you found a good solution in the meantime. Maybe you can post it when you are done.

On Monday we will prepare a tutorial about how to create a simple main menu, which should answer some of the questions you had.
Offline bfox  
#10 Posted : Saturday, January 7, 2012 2:50:52 PM(UTC)
bfox

Joined: 8/22/2011(UTC)
Posts: 170
Location: Moscow

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: Benjamin Nitschke (DeltaEngine) Go to Quoted Post
If you cannot access internals of Delta.Scenes in Delta.Scenes.Tests then probably the obfuscation of the public repository has a bug and causes it to not work anymore. But as I said before it is probably not the best solution anyway.

Hopefully you found a good solution in the meantime. Maybe you can post it when you are done.

On Monday we will prepare a tutorial about how to create a simple main menu, which should answer some of the questions you had.

I post my code when done something interesting.
Russian game developer.
Давайте делать игры в команде. Идет набор.
Offline bfox  
#11 Posted : Saturday, January 7, 2012 10:16:41 PM(UTC)
bfox

Joined: 8/22/2011(UTC)
Posts: 170
Location: Moscow

Thanks: 3 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: Benjamin Nitschke (DeltaEngine) Go to Quoted Post
..... Maybe you can post it when you are done......

http://forum.deltaengine...le-by-BFoX.aspx#post1447
Russian game developer.
Давайте делать игры в команде. Идет набор.
Offline Benjamin  
#12 Posted : Monday, January 9, 2012 11:54:43 PM(UTC)
Benjamin

Medals: Admin

Joined: 8/20/2011(UTC)
Posts: 1,421
Location: Hannover

Thanks: 18 times
Was thanked: 97 time(s) in 92 post(s)
Also check out the upcoming nightly release, we have a new Tutorial in Delta.Scenes.Tests: TestSimpleMainMenu, which shows how to program a main menu very efficiently with simple screen classes and just a few lines of codes.
Rss Feed  Atom Feed
Users browsing this topic
OceanSpiders 2.0
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2019, Yet Another Forum.NET
This page was generated in 0.360 seconds.