GLBasic forum

Main forum => GLBasic - en => Topic started by: Hark0 on 2008-Sep-27

Title: Disable/hide "Loading..." message.
Post by: Hark0 on 2008-Sep-27
Hi!

My question it's very simple...

It's possible to hide/disable the message "Loading..." that's appear at start the application?


TIA, Hark0
Title: Re: Disable/hide "Loading..." message.
Post by: MrTAToad on 2008-Sep-27
I would think a BLACKSCREEN/SHOWSCREEN combination would sort that.

Of course, if loading times are going to be long, you should at least tell the user what is happening.
Title: Re: Disable/hide "Loading..." message.
Post by: Hatonastick on 2008-Sep-28
True, but it would be nice to hide it and then display your own "please wait" message.  The only problem I have with the built-in one is that sometimes it can clash with the style of presentation you go with in the rest of the program.

Hope Im making sense.
Title: Re: Disable/hide "Loading..." message.
Post by: Moru on 2008-Sep-28
I think the loading screen only shows until your program executes the first SHOWSCREEN command so you can implement any loadscreen you want, even saying how far into the load process you are by updating a colorbar. See the load function for fonts in the Bitmap fonts library on my homepage. It shows how far it is in the kerning routine but only the first time it runs. Just delete the *.kern files to get the load screen again :-)
Title: Re: Disable/hide "Loading..." message.
Post by: Hark0 on 2008-Sep-28
I tried the "minimal" commands needed for "Init" the application:

SETSHOEBOX "resources.sbx",""
LOADBMP "resources/image.png"
SHOWSCREEN
...
...

The results are "spected"... the screen shows "Loading..." at center screen and about 1.5 secs, the image appears.

I think one "trick solution".
It's replace manually on final app EXE with hex editor the "Loading..." with another text (max.  10 chrs.).


Probably a good option would be if GLBasic Team add's an Textlabel on Project>Options screen for edit/modify this "Loading..." text.
(It is only a humble opinion).  =D

Regards.


EDIT: Ooooops! The 1.5 secs. time exposed are on WINCE device... don't worry!  ;)
Title: Re: Disable/hide "Loading..." message.
Post by: MrTAToad on 2008-Sep-28
What about doing :

BLACKSCREEN
SHOWSCREEN
SETSHOEBOX "resources.sbx",""
LOADBMP "resources/image.png"
etc...
Title: Re: Disable/hide "Loading..." message.
Post by: Hemlos on 2008-Oct-09
Quote from: Hark0 on 2008-Sep-28
I think one "trick solution".
It's replace manually on final app EXE with hex editor the "Loading..." with another text (max.  10 chrs.).

Heres how you can do exactly that without a hex editor:
1.  First make a font "smalfont.png" with Dings font tool
2.  Then add this function CENTERPRINT(): (centers your text in middle of screen, using your font)
3.  Call it before you load stuff like this: FORMAT: CENTERPRINT("Loading Stuff")
Note: you can call the function as many times as you want..you can even get creative with it..
       CENTERPRINT("Loading Stuff")
     CENTERPRINT("..Loading Stuff..")
   CENTERPRINT("....Loading Stuff....")
CENTERPRINT("......Loading Stuff......")

Code (change loading messages:) Select

CENTERPRINT("Loading Shoebox")
SETSHOEBOX "resources.sbx",""

CENTERPRINT("Loading Graphics")
LOADBMP "resources/image.png"

WHILE TRUE
Print "Main Loop",10,10; SHOWSCREEN
WEND

FUNCTION CENTERPRINT: TEXT$
STATIC fx,fy,sx,sy,INIT_FONT //stores font info in function memory
IF INIT_FONT=FALSE ; INIT_FONT=TRUE //do once, store info in static memory.
  LOADFONT "smalfont.png",1;
  //REM: If it is located in "resources" dir:    LOADFONT "./resources/smalfont.png",1;
  SETFONT 1;
  GETFONTSIZE fx,fy; GETSCREENSIZE sx, sy
ENDIF
LOCAL MsgCenX,MsgCenY
MesCenX=(sx/2)-(LEN(TEXT$)*fx/2)  //center the message in X-plane
MesCenY=(sy/2)-(fy/2) //center the message in y-plane
PRINT TEXT$,MesCenX,MesCenY  //print it
SHOWSCREEN  //show it
ENDFUNCTION


PS Note: All the above suggestions will work for both removing the message and changing it.

You can get very creative with the loading stuff...as moru suggested you can even make it graphical with a loading bar.......Personal experience: i have a very large program that loads alot of data, and it loads doing it exactly like that...with a sliding load bar, and a text message stating what exactly is loading.
Title: Re: Disable/hide "Loading..." message.
Post by: Hatonastick on 2008-Oct-10
Ahhh nice one! :)  I'm sadistic as I prefer leaving people facing a blank screen while the program spends 10-15 seconds loading something. :D
Title: Re: Disable/hide "Loading..." message.
Post by: Hark0 on 2008-Oct-10
Quote from: Hemlos on 2008-Oct-09
Quote from: Hark0 on 2008-Sep-28
I think one "trick solution".
It's replace manually on final app EXE with hex editor the "Loading..." with another text (max.  10 chrs.).

Heres how you can do exactly that without a hex editor:
1.  First make a font "smalfont.png" with Dings font tool
2.  Then add this function CENTERPRINT(): (centers your text in middle of screen, using your font)
3.  Call it before you load stuff like this: FORMAT: CENTERPRINT("Loading Stuff")
Note: you can call the function as many times as you want..you can even get creative with it..
       CENTERPRINT("Loading Stuff")
     CENTERPRINT("..Loading Stuff..")
   CENTERPRINT("....Loading Stuff....")
CENTERPRINT("......Loading Stuff......")

Code (change loading messages:) Select

CENTERPRINT("Loading Shoebox")
SETSHOEBOX "resources.sbx",""

CENTERPRINT("Loading Graphics")
LOADBMP "resources/image.png"

WHILE TRUE
Print "Main Loop",10,10; SHOWSCREEN
WEND

FUNCTION CENTERPRINT: TEXT$
STATIC fx,fy,sx,sy,INIT_FONT //stores font info in function memory
IF INIT_FONT=FALSE ; INIT_FONT=TRUE //do once, store info in static memory.
  LOADFONT "smalfont.png",1;
  //REM: If it is located in "resources" dir:    LOADFONT "./resources/smalfont.png",1;
  SETFONT 1;
  GETFONTSIZE fx,fy; GETSCREENSIZE sx, sy
ENDIF
LOCAL MsgCenX,MsgCenY
MesCenX=(sx/2)-(LEN(TEXT$)*fx/2)  //center the message in X-plane
MesCenY=(sy/2)-(fy/2) //center the message in y-plane
PRINT TEXT$,MesCenX,MesCenY  //print it
SHOWSCREEN  //show it
ENDFUNCTION


PS Note: All the above suggestions will work for both removing the message and changing it.

You can get very creative with the loading stuff...as moru suggested you can even make it graphical with a loading bar.......Personal experience: i have a very large program that loads alot of data, and it loads doing it exactly like that...with a sliding load bar, and a text message stating what exactly is loading.


THANKS!!! I try it!!!  :good: