How to make a loading screen GUI wait for the game to loaded first before deleting itself? in Roblox studio? - lua

So I was developeding a game using Roblox studio (Roblox Game engine) I was just making a simple loading screen that stay until the game is fully loaded but I don't know how to make the loading screen actually stay on the user ScreenGUI until the game fully loaded.
I want to make a simple loading screen on Roblox studio that deleted itself after the game fully loaded.
But I don't know how to make the loading screen to wait for the game to fully loaded first before deleting itself.

Just make a script inside the GUI, the GUI elements should be in a GUI element (other than ScreenGUI) to make it easier, and the script should be in that element. Here is what the script would look like:
frame = script.Parent
game.Loaded:Connect(function()
frame.Visible = false
end)
This script checks if the game is loaded, and when it is, it hides the parent. As stated before, the parent should be the frame holding all the content, or any other GUI element, I would recommend Frame, as it is only a bold color and will not have any effect unless applied in the Frame or through a script.

Related

Windows Style Theming Makes Window Stutter When Dragged

I have investigated this problem across some different computers with theming/classic-theme and/or theme support disabled in my app...
Problem when Windows is configured to draw the window while dragged + theme drawing enabled:
My primary app window stutters greatly when dragged around screen. It is even so bad that if I drag the window e.g. 10 inches left and releases mouse button... The Window will then continue to move around the screen for 2-5 seconds more!
Speculation #1
I think the message queue may be flooded with paint-message related stuff meaning the move-messages get delayed? (which then again causes paints) Maybe some postmessage/sendmessage queuing going wrong.
What I have tried
I created some code that went through all controls in my form and disabled all events I could think of + called .Hide on them all -- this has no effect on the problem... However, I then created some code that went through all controls and removed them entirely -- this solves the problem if I remove say 50-80% of the controls.
Speculation #2
Is Windows draw style theming also done on controls not visible? (e.g. if placed on a TTabSheet not currently active?)
Other notes
In all honesty my form is very large (I spit out 7 different tools which all use most of it)
It is possible a TFrame based solution - as long as not loaded into memory - could solve this. But there are many problem in this... For one I have not abstracted reading e.g. options... I.e. I read myCheckbox.Checked to determine if a given option is enabled before passing it on my separated business logic.
But it is possible if I had a layer inbetween I could load TFrames as necessary... But it will be major work to convert to this.
...
Any ideas on how to workaround this? Reducing the problem is enough... I am thinking about:
a) Removing what I can.
b) Replacing what I can with stuff not style theme drawn. (E.g. "debug" controls I use myself to understand what is going on)
c) Maybe loading some stuff in TFrame instead
d) Trying to figure out why invisible controls cause problems for the style theme drawing... Could I have them ignored somehow?
e) Disable themning while drawing?
f) Disable having window drawn while dragged even if Windows is configured to draw Windows while they are being dragged.
g) WM_WINDOWPOSCHANGING / WM_WINDOWPOSCHANGED and disable align + draw while it happens.

cocos2d-js, is there a way to stop cc.game and rebind it to another canvas and then restart the game?

I try to have a canvas inside a query mobile page, first time it runs well, but when I switch to another page and removed the page containing canvas from the dom, and switch back again, I try to setup the game once more, it didn't work
how to end the cc.game properly so I can reconfigure it again?

Using Mouse.SetPosition for FPS mouse look but takes over mouse for all windows app

I have a FPS game and using mouse look. I use Mouse.SetPosition to set the mouse position back to center of the game window at every frame. This works great and the mouse look is working very good. The problem is this takes over mouse position for every windows app. If I alt tab to another app, the mouse constantly tries to goto the center of the game window. This seems like very bad behavior. Any idea how to fix this behavior but still allow my mouse look to still work?
It has to do with User32.dll
I was programing an autoclicker to do my homework (AI) simple
And this website helped me alot...
http://www.codeproject.com/Articles/32556/Auto-Clicker-C

XNA - how to determine which window has focus?

I'm thinking about writing an XNA game for Windows. It will have the main game window and another WPF form that has some chat controls or debugging information. When I'm typing something into this auxiliary form, obviously I don't want the main XNA window to see what I'm typing.
What is the best way to do this? I thought that if I can determine if the auxiliary window has the focus, I could ignore any keystrokes in my game loop. But making that determination isn't obvious in XNA. How is this done?
Check Game.IsActive (MSDN) before responding to any input changes.

Is Flash Player "Low quality" setting only about anti-aliasing?

It not just my curiosity, recently I've received a bugreport concerning one of my AS3 applications. This bug can be reproduced only if the quality in flash player is set to LOW (HIGH/MEDIUM - everything is ok). The bug changes the application behaviour, but it's a mystery for me, why it happens only for LOW quality while quality is said to influence rendering and visual appearance, not the code or behaviour.
Briefly, I have a menu panel (MovieClip) with several items (also MovieClips). Very simple, it appears on a screen after a MouseEvent and a user moves a cursor from one element down to another. When the cursor reaches the edge of the second item, the menu suddenly disappears.
In my code panel hiding is set on mouse click or mouse out.
Personally, I think, that the problem is in Tweener, I have to use that old piece of code. The menu panel is shown when mouse is above a user icon, and concurrently with the help of Tweener I produce some simple effects on this icon.
I have explored adobe and firefox (my app is for web browsers and the bug is reported for firefox) bugtrackers, but so far I have found nothing. Maybe misbehaviour of flash player 11 with Arrays, already fixed... I've run out of ideas.
From the docs:
LOW
Specifies low rendering quality: graphics are not anti-aliased, and bitmaps are not smoothed.
If it only happens when rendering it set to low, then it's probably a timing issue - i.e., the bug has always been there, but because you're wrapping up rendering earlier, you can trigger then bug. Is the bug reporter's computer a slow one? Is there a lot happening at once? Is the menu being removed, set to invisible, or repositioned?
Like #jeremynealbrown said, try and separate out your class to a simple project to make sure there's nothing wrong with your logic there.
Another method, override the removeChild() method, and visible and x and y properties to see which one is setting it, then put traces before all calls that call these to see what's triggering it.
If you think the problem is in Tweener, add a MOUSE_OVER listener to the menu panel that calls something like removeAllTweens(), no matter the state of the menu panel. If the bug doesn't happen anymore, this will show you that it's related to the tween engine.

Resources