Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [ AGK] Sprites Question + Loading Screen Model

Author
Message
Alex Goaga
9
Years of Service
User Offline
Joined: 6th Nov 2015
Location:
Posted: 30th Jan 2016 15:54
Hi guys, I have another question about 2 features presented in AppGameKit ( steam version ) .

The first one is about the text , buttons and sprites .
For example i want to create a menu button with a specific image and with a text above the sprite using the following code.


( *it has some alignment issues , but i will fix them in time )

This is creating my sprite with the specific img ( eg id 6 ) but the text is under the picture.
Questions :
a) How i do put any text above any sprite?
b) Why the text looks i dont know how to detail / explain , it looks like an rpg game text. ( it's nice but what i can do if i want to change it a little ?)
c) Is anyway i can make a code / function to make the calculate width of the text and if is too long , to move it on the next row? For example if I do create a button and i want a long sentence it goes on a single row and outside the button.

About the Loading Screen Model

After some searches on the forum , I came across 2 types of loading screen models. One containing the command delay and one with some function that runs before the main menu system.

There were people that were complaining about the output performance resulted by using any of them for the app
So my questions are :
a) Witch model is better to use in order to have the best performance? i dont know ...
My idea is to have 2 pictures ( a and b for example ). The A comes first with a fade in effect ( just like a power point presentation ) then after i dont know 2-3 seconds to fade out and the picture B should come again using a fade in afect and afer that , fade out after 2-3 seconds then the main menu to appear.
b) Can anybody or if it exist the simplest function of a functioning Loading Screen Model on the forum ? I didn't manage to find at least one compatible with AGK

Thank you for your time,
I hope i did manage to explain what my issues are
If not, i can detail more.

Again, thank you for your time,
Alex


Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 30th Jan 2016 16:02 Edited at: 30th Jan 2016 16:04
You can control what is drawn above what by using the depth commands. I think you should look through the text section of the commands in the help files. Figuring things out by yourself is the best way to learn how to code. Looking through the sprite commands is also useful.
Alex Goaga
9
Years of Service
User Offline
Joined: 6th Nov 2015
Location:
Posted: 30th Jan 2016 19:51
Thanks for the tip for how to manage the text problem, I looked in the documentation but my idea of command was Set-Text-Above / Below instead of the real command " SetTextDepth ".

How about the loading screen idea ?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 31st Jan 2016 09:16
Loading screens are not just for display purposes, they are the Smoke and Mirrors that hide the time it takes to load your game assets. Where you say...

Quote: "...then after i dont know 2-3 seconds to fade out and the picture B should come again..."


What you should plan for is:

* Show loading screen
* Load game assets
* If it took less than 3 seconds, delay until 3 seconds have expired

As you have 2 loading screens, you can split the workload between the 2 screens, giving you 6 seconds to load everything.

You could also take advantage of the Tween commands to do your fading for you. This tutorial uses Tweens.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 31st Jan 2016 10:01
This is how I do it in my game. I don't have much to load so I do everything at the beginning.
1) Setup screen
2) Load company logo
3) Sync to draw logo to screen
4) Start music
5) Load everything
6) Animate intro

Show something on the screen. Maybe play some music. Load everything you need. Once loading is done the code will automatically advance. Do it every time you have long loading times. If the loading time is very short you can just fade to black, load, fade back. I do this when my levels are loading.

One thing to remember is that you can't have smooth fading while loading. The screen will freeze every time you load something. Unless you expect to have a very long loading time I think it's best to stick to one static loading screen.
Ched80
14
Years of Service
User Offline
Joined: 18th Sep 2010
Location: Peterborough, UK
Posted: 31st Jan 2016 21:44
I do my intro, pretty much identical DA I have quite a bit to load, but it's all done with 10 or so seconds.

1. I load the splash screen and music, set up the screen and call sync to get something in front of the player's eyes and ears as soon as possible.

2. Then I load everything, create the sprites and text, load in all the scripts, equipment files, player saves, etc.

3. Then I kick off the animated intro, which can be skipped.

4. Finally the menu screen is shown.
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 1st Feb 2016 10:43
It's exactly the same as me, just described differently

Login to post a reply

Server time is: 2024-11-25 11:18:56
Your offset time is: 2024-11-25 11:18:56