March 28, 2024, 02:04:27 pm
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
Forever
Login with username, password and session length
News
: Want to see a specific Tutorial? ASK!
Home
Help
Search
Arcade
Links
Staff List
Login
Register
[QUESTION] QB64 and program loading
Weekly Qbasic and Qb64 Lesson Topics
>
Forum
>
General Category
>
General QB64 Forum
>
[QUESTION] QB64 and program loading
Pages: [
1
]
« previous
next »
Print
Author
Topic: [QUESTION] QB64 and program loading (Read 2158 times)
Draugr
Newbie
Posts: 2
[QUESTION] QB64 and program loading
«
on:
April 02, 2012, 03:17:51 pm »
Hi everyone.
I have a question. I am looking to create a single executable file that when run will display a splash (title) image for 4 or 5 seconds in the center of the screen, then launch the main program. I wanted to know if something like this is possible in QB64 and will a single compiled exe be able to work in 32 and/or 64 bit versions of Windows or will separate 32 and 64 bit images be required?
Here is the basic idea of what I'm looking to achieve. The latter part I have working via a standard batch file, but the splash screen aspect isn't possible in a simple batch screen so I'm hoping QB64 might be able to do this.
Example:
run start.exe
Splash screen shows for 4 seconds then the exe performs the following code
cd game
dragons.exe
The program Dragons then launches.
I know its probably fairly simple and even though I'm not a QB guru I know I could figure out how to do the latter part, but the whole splash screen aspect is where I'd be lost. Also, if this is possible, is it also possible to hide the actual image within the executable so that the end user could not simply go into the folders for the program and access the splash_image.jpg file? I'd love it if it could be somehow merged internally within the compiled exe file.
I appreciate any advice or help.
Thanks
John
Report Spam
Logged
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Re: [QUESTION] QB64 and program loading
«
Reply #1
on:
April 03, 2012, 09:30:36 pm »
On the 32 and 64 bit , I am not sure, I can get back on that later. On the "splash" image,
that is very much possible, a image can be converted into data file, that is then included in the "program", When a lot of images are used, this is not very practical, but with just one "spalsh" image, that loads for a few seconds, it would be ok.
Every thing you are thinking about here, can be done, I am sure,
How ever I can see, by the example you wrote, you will need to learn some about the qb64 commands,..
There is a example, of useing a data file to load a image, here on the forum, but it has been so long, I need to look for it, and also a qb64 program, that can convert images to data, I believe it is limited to BMP,
Converts a .BMP to DRAW see this thread
When a executable is compiled, there are some DLL files that must be include with the program, for windows, my thoughts, are that would be all you would need to do, include the DLL s, form the 32 bit ver, for the 32 bit, and I am sure the DLL files for the 64 bit, are different, so you would need to include those, I can check on that.
or it might be faster and easier for you to, post the same question, on
http://www.qb64.net
You will need to register, to login and post just as you did here.
Using a data file within the program, once the program is compiled, into a .exe , no one would be able to "copy" or get the image,out of the program, one could make a "screen shot", maybe, but if it is a "splash" image, they probabley wouldn't have time.
I do not use windows, I use Linux, so on some of this,I can not help much.
from Garry
Edited:
NEW EDIT
I made a example, with a game, SMGBGE, written by Terrie Richie, it is to large to post the entire .bas here, so I have put it on drop box,
http://dl.dropbox.com/u/15387474/SMGBUG-qb64splash.bas.zip
This is only a .bas file , you will need to compile it with qb64. It displays the "spalsh image" (qb64 logo) about 3 seconds, then it starts the game, ..with no chdir, or separate programs,
You may want to check it out.
from Garry
«
Last Edit: April 04, 2012, 11:26:48 pm by GarrisonRicketson
»
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Re: [QUESTION] QB64 and program loading
«
Reply #2
on:
April 03, 2012, 10:02:26 pm »
This is a example of using a data file for the image. In this case it is a small bunny, that moves back and forth across the screen, the code can be copied and pasted, into note pad, or most any text editor, or directly in to the qb64 IDE and saved as the .bas , once compiled into a executable, the source (.bas) is not visbable, in the executable, ...I am assumeing you know how to do that,..if not I will need to explain from scratch, starting with some real simple things, ..
Code:
'moving the bunny back and forth:
limitfps% = 32
bunnymaxsp% = 100 * limitfps% '*pixels/sec
bunnydirection% = 1
bunnyspeed% = bunnymaxsp% / limitfps%
BunnyWidth% = 16
BunnyHeight% = 16
SCREEN 13
OUT &H3C8, 0
OUT &H3C9, 0
OUT &H3C9, 48
_FULLSCREEN
CLS
' Bitmap for the sprite
DATA 0,0,0,0,0,15,0,0,0,0,15,0,0,0,0,0,0
DATA 0,0,0,0,0,15,15,0,0,15,15,0,0,0,0,0,0
DATA 0,0,0,0,0,0,15,0,0,0,15,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,15,15,15,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,15,15,15,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,15,0,15,0,15,0,0,0,0,0,0
DATA 0,0,0,0,0,0,15,15,15,15,15,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,15,15,15,15,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,15,15,15,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,15,15,15,15,15,0,0,0,0,0
DATA 0,0,0,0,0,0,15,15,15,15,15,15,0,0,0,0,0
DATA 0,0,0,0,0,15,0,15,15,15,15,0,15,0,0,0,0
DATA 0,0,0,0,0,0,0,0,15,15,15,15,0,0,0,0,0
DATA 0,0,0,0,0,0,15,15,0,0,0,0,15,15,0,0,0
DATA 0,0,0,15,15,15,0,0,0,0,0,0,15,15,15,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
DATA 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
' An array to hold the sprite
DIM Bunny%(BunnyWidth%, BunnyHeight%)
' Read the sprite in from DATA to the array
FOR Y = 0 TO BunnyHeight%
FOR X = 0 TO BunnyWidth%
READ Bunny%(X, Y)
NEXT X
NEXT Y
bunnystart# = TIMER(.001)
bunnydirection% = 1
BunnyStartx% = 0
dothisstuff% = 1
DO
DO
LOOP UNTIL _MOUSEINPUT = 0
SELECT CASE INKEY$
CASE CHR$(27)
dothisstuff% = 0
END SELECT
IF dothisstuff% THEN
CLS
'* your mouse and key handling here
IF bunnypositionx% >= _WIDTH(0) - BunnyWidth% THEN '* BunnyWidth% is width of bunny image
bunnydirection% = -bunnydirection%
BunnyStartx% = bunnypositionx% - 1
bunnystart# = TIMER(.001)
ELSEIF bunnypositionx% < 0 THEN
bunnydirection% = -bunnydirection%
BunnyStartx% = bunnypositionx% + 1
bunnystart# = TIMER(.001)
END IF
bunnypositionx% = BunnyStartx% + bunnydirection% * bunnyspeed% * (TIMER(.001) - bunnystart#)
PUT2 Bunny%(), BunnyWidth%, BunnyHeight%, bunnypositionx%, 170
_DISPLAY
_LIMIT limitfps%
ELSE
EXIT DO
END IF
LOOP
SUB PUT2 (Sprite() AS INTEGER, XSize AS INTEGER, YSize AS INTEGER, X AS INTEGER, Y AS INTEGER)
' Draw the sprite from the array onto the screen
FOR YP = 0 TO YSize - 1
FOR XP = 0 TO XSize - 1
PSET (X + XP, Y + YP), Sprite(XP, YP)
NEXT XP
NEXT YP
END SUB
After you paste this code into the qb64 editor (IDE), select Run, when it runs it automaticly creates the executable, to save it select the SAVE AS (filename.bas) usually the executable will also have the same name (filename.exe), however on mine, (qb64 for Linux), sometimes, the executable, still comes out "untitled", so you may want to check that if you don't see the filename you choose, look for a "untitled.exe", try running it, if it is the correct program, the one you just compiled, re-name it to whatever name you want.
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Re: [QUESTION] QB64 and program loading
«
Reply #3
on:
April 03, 2012, 10:50:23 pm »
This is another example of a image , without any .jpg or image file out side of the program,
More details can be gotten in this thread:
"Mask" image,and makeing a mask image
This is the code ( written by Quark )for this image:
Code:
'==============================================================================
_TITLE "***MASK 8X16 FUJI ***" 'by Quark 7/11
DEFDBL A-Z
SCREEN _NEWIMAGE(808, 616, 256)
DIM SHARED rows, cols
maskrows = 37: maskcols = 100
DIM SHARED mask(maskrows, maskcols) AS STRING
DIM SHARED brush AS STRING
DIM drawbrush AS STRING: drawbrush$ = CHR$(219)
DIM maskbrush AS STRING: maskbrush$ = CHR$(177)
DIM drawcolor, maskcolor, commentcolor AS INTEGER
drawcolor = 0: maskcolor = 11: commentcolor = 15
rows = INT(_HEIGHT / 8 - 1): cols = INT(_WIDTH / 5 - 1)
RANDOMIZE (TIMER)
'------------------------------------------------------------------------------
FOR r = 1 TO maskrows: READ t$
FOR c = 1 TO maskcols
mask(r, c) = MID$(t$, c, 1)
NEXT: NEXT
DO
FOR r = 1 TO maskrows
FOR c = 1 TO maskcols
SELECT CASE mask(r, c)
CASE "A"
COLOR 0: IF Chance%(1, 10) THEN COLOR 8
CASE "B"
COLOR 1: IF Chance%(1, 10) THEN COLOR 9
CASE "C"
COLOR 2: IF Chance%(1, 10) THEN COLOR 10
CASE "D"
COLOR 3: IF Chance%(1, 10) THEN COLOR 11
CASE "E"
COLOR 4: IF Chance%(1, 10) THEN COLOR 6
CASE "F"
COLOR 5: IF Chance%(1, 10) THEN COLOR 13
CASE "G"
COLOR 6: IF Chance%(1, 10) THEN COLOR 4
CASE "H"
COLOR 7: IF Chance%(1, 10) THEN COLOR 15
CASE "I"
COLOR 8: IF Chance%(1, 10) THEN COLOR 7
CASE "J"
COLOR 9: IF Chance%(1, 10) THEN COLOR 3
CASE "K"
COLOR 10: IF Chance%(1, 10) THEN COLOR 2
CASE "L"
COLOR 11: IF Chance%(1, 10) THEN COLOR 3
CASE "M"
COLOR 12: IF Chance%(1, 10) THEN COLOR 4
CASE "N"
COLOR 13: IF Chance%(1, 10) THEN COLOR 5
CASE "O"
COLOR 14: IF Chance%(1, 10) THEN COLOR 15
CASE "P"
COLOR 15: IF Chance%(1, 10) THEN COLOR 7
CASE ELSE
COLOR ASC(mask(r, c)) - 65
END SELECT
LOCATE r, c: PRINT "ŝ";
NEXT: NEXT
_DELAY (.15)
LOOP UNTIL INKEY$ = CHR$(27)
SLEEP: END
'==============================================================================
FUNCTION RndRange% (lo AS INTEGER, hi AS INTEGER)
DIM r AS INTEGER
r = hi - lo + 1
RndRange% = INT(RND(1) * (hi - lo + 1) + lo)
END FUNCTION
'------------------------------------------------------------------------------
FUNCTION Chance% (lo AS INTEGER, hi AS INTEGER)
'returns 1 if chance is successful, 0 otherwise
IF lo >= hi THEN Chance% = -1
Chance% = INT(RND * hi) < lo
END FUNCTION
'------------------------------------------------------------------------------
DATA "ABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
DATA "ABBBBHBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBHHBBHPHPPHBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA"
DATA "ABBBBHHPHPHPPPHHPBHPPBBHPHBBBBBBBBBBBBBBBBBHHPHHPHBBBBBBBBPHHHPHBHHHHBBBHBBAAPPPABBBBBBBBBBHHPPHPBBA"
DATA "ABBBBBBBBBBHHPHBPHHBBHBBBBBBBBBBBBBBHHPPPHBBBBBBBBBBBBBBBHHHPPBPHHHBHHHHBBAPPPPPPABBHPHBHHHPHPHBBBBA"
DATA "ABJJBBBBBBBBBBBBBBBBBJBJJJJJBBBJBJJBBBBBJJBJBBBBBJJBBBBJJJBBBBBBBBDBBBBBIAPPJPPJPPPABBBBBBBBBBBBBBBA"
DATA "AJBJJJBBBDJDJDDBJBJJDBBJJDJJJDJJJJJBJJDDJJJDDDJBDJJJJDDDBDDJJBJBJJBDBBBAIJJJJJJJJJJHABBBBBDBJDJBBDBA"
DATA "ABJJJJBJJDBJDDJBJDJJJBJDJJJDDBBBJDDJJDDJJJBBBBJJDDJBBBBJDJJJDBBBBBDBBIAHJJJJJJJJJJJJJABBBBBDDBBBBDBA"
DATA "AAAAACCCCCCCCCKCKCKKCAAAAAAAAACKCKCCCCCKCKCCCAAAAAACCKCCCCCKCAAAAAAAAILLLJJLJJ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JJBBJJJJJJJJJJJJJJJJA"
DATA "ABAAJBFFFJJJLBBBJJLLLJJJJLLLJLBBBLLLLBBBBBBBBBBBJAJJJJJJLJJJJJJJJJJJJBBBJJJJJJJJBAAJJJJJJJJJJJJJJJBA"
DATA "ABFFFFAAAAJLLLJJLLLJJJJJJJJLLJJJBBBAAJJJBJJJJJJJBBBBBBBFJJFFFJJJBBBBAAJJJJJJJJJJJBBBABBBBBBBBBBBBBJA"
DATA "BBBABBBBBBBBJJJJJJJJJJJAJJAAJAAJJJJAAABABBBBBAAAAJABBABBBBBBBBBBAJJJJJJJJJJJJJJJJJJJJJJJJJJLLLLLJÛJA"
DATA "AAAAJJJJJJJJBPJJAAAAAJJJJAJJPPJJAAJAAJJJJJJJJBBBBBBJJJJJPJJJJJJJJJJPPPPJPPPPPPLLLJJJJJPPLLLBBBBJJJJA"
DATA "AJJJJJJFFJFFFJPPAPPBPPPPPPPPBPPPPBBBBABAAAAAAAJJJLLLLJLLPPPPPJPJPPAJJJAJJJJJJJJFFLJJJJJJPPPHPHPPJJJA"
DATA "ABBJBJBBBBBBBJJJJJFFAAJJJJJAAAAAAPPPPPPBPBBBBLAAAAABAAAAAAABAAAABBBJJJJFJJBJBJBJBBJBJBBBBJJJJJJBBBBA"
DATA "AJPPPJJPJPJPPPPPPPPJPPAPAAFFBFJBBABBABBAABBBBJJJJJJJAAAAAAAJAJBJBJJBBBBJBJBJBBBJBJBBJBBBJBBBBJBJJJJA"
DATA "AJJJJJJJJJJPJJJJJJBBBJBJBBAAJJJJJJJJJJAAAAFABFFJBJJBBJBFJBJBAAAAAJAJAAAAAAAAJJJJJJJJJJJJJJJJJJJJJJJA"
DATA "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
Obviously a simpler image, would be less code and simpler, I am going to work on adding code, that makes the image only appear for a few second.
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Re: [QUESTION] QB64 and program loading
«
Reply #4
on:
April 03, 2012, 11:12:37 pm »
Quote from: Draugr on April 02, 2012, 03:17:51 pm
I wanted to know if something like this is possible in QB64 and will a single compiled exe be able to work in 32 and/or 64 bit versions of Windows or will separate 32 and 64 bit images be required?
Here is the basic idea of what I'm looking to achieve. The latter part I have working via a standard batch file, but the splash screen aspect isn't possible in a simple batch screen so I'm hoping QB64 might be able to do this.
Example:
run start.exe
Splash screen shows for 4 seconds then the exe performs the following code
cd game
dragons.exe
The program Dragons then launches.
I know its probably fairly simple and even though I'm not a QB guru I know I could figure out how to do the latter part, but the whole splash screen aspect is where I'd be lost. Also, if this is possible, is it also possible to hide the actual image within the executable so that the end user could not simply go into the folders for the program and access the splash_image.jpg file? I'd love it if it could be somehow merged internally within the compiled exe file.
I appreciate any advice or help.
Thanks
John
On the """ will a single compiled exe be able to work in 32 and/or 64 bit versions of Windows or will separate 32 and 64 bit images be required?""" Apparently YES, it will work, on a either one.
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Splash Image
«
Reply #5
on:
April 04, 2012, 12:18:29 am »
Ok I did modify, the "Mask" image, code, it now only displays for about 5 seconds,
Code:
'==============================================================================
_TITLE "***MASK 8X16 FUJI ***" 'by Quark 7/11
DEFDBL A-Z
SCREEN _NEWIMAGE(808, 616, 256)
DIM SHARED rows, cols
maskrows = 37: maskcols = 100
DIM SHARED mask(maskrows, maskcols) AS STRING
DIM SHARED brush AS STRING
DIM drawbrush AS STRING: drawbrush$ = CHR$(219)
DIM maskbrush AS STRING: maskbrush$ = CHR$(177)
DIM drawcolor, maskcolor, commentcolor AS INTEGER
drawcolor = 0: maskcolor = 11: commentcolor = 15
rows = INT(_HEIGHT / 8 - 1): cols = INT(_WIDTH / 5 - 1)
RANDOMIZE (TIMER)
'------------------------------------------------------------------------------
FOR r = 1 TO maskrows: READ t$
FOR c = 1 TO maskcols
mask(r, c) = MID$(t$, c, 1)
NEXT: NEXT
DO
FOR r = 1 TO maskrows
FOR c = 1 TO maskcols
SELECT CASE mask(r, c)
CASE "A"
COLOR 0: IF Chance%(1, 10) THEN COLOR 8
CASE "B"
COLOR 1: IF Chance%(1, 10) THEN COLOR 9
CASE "C"
COLOR 2: IF Chance%(1, 10) THEN COLOR 10
CASE "D"
COLOR 3: IF Chance%(1, 10) THEN COLOR 11
CASE "E"
COLOR 4: IF Chance%(1, 10) THEN COLOR 6
CASE "F"
COLOR 5: IF Chance%(1, 10) THEN COLOR 13
CASE "G"
COLOR 6: IF Chance%(1, 10) THEN COLOR 4
CASE "H"
COLOR 7: IF Chance%(1, 10) THEN COLOR 15
CASE "I"
COLOR 8: IF Chance%(1, 10) THEN COLOR 7
CASE "J"
COLOR 9: IF Chance%(1, 10) THEN COLOR 3
CASE "K"
COLOR 10: IF Chance%(1, 10) THEN COLOR 2
CASE "L"
COLOR 11: IF Chance%(1, 10) THEN COLOR 3
CASE "M"
COLOR 12: IF Chance%(1, 10) THEN COLOR 4
CASE "N"
COLOR 13: IF Chance%(1, 10) THEN COLOR 5
CASE "O"
COLOR 14: IF Chance%(1, 10) THEN COLOR 15
CASE "P"
COLOR 15: IF Chance%(1, 10) THEN COLOR 7
CASE ELSE
COLOR ASC(mask(r, c)) - 65
END SELECT
LOCATE r, c: PRINT "ŝ";
NEXT: NEXT
_DELAY 5 '// I changed the delay to 5 and added this below,
CLS
DEF SEG = 0 ' set to PEEK and POKE TIMER Ticks
POKE 550, 0 ' zero Timer tick
' loop code
PRINT "one more"
LOOP UNTIL PEEK(550) >= 0
DEF SEG ' reset segment to default
'//the rest of the code is the same, no modification.
SLEEP: END
'==============================================================================
FUNCTION RndRange% (lo AS INTEGER, hi AS INTEGER)
DIM r AS INTEGER
r = hi - lo + 1
RndRange% = INT(RND(1) * (hi - lo + 1) + lo)
END FUNCTION
'------------------------------------------------------------------------------
FUNCTION Chance% (lo AS INTEGER, hi AS INTEGER)
'returns 1 if chance is successful, 0 otherwise
IF lo >= hi THEN Chance% = -1
Chance% = INT(RND * hi) < lo
END FUNCTION
'------------------------------------------------------------------------------
DATA "ABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
DATA "ABBBBHBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBHHBBHPHPPHBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBA"
DATA "ABBBBHHPHPHPPPHHPBHPPBBHPHBBBBBBBBBBBBBBBBBHHPHHPHBBBBBBBBPHHHPHBHHHHBBBHBBAAPPPABBBBBBBBBBHHPPHPBBA"
DATA "ABBBBBBBBBBHHPHBPHHBBHBBBBBBBBBBBBBBHHPPPHBBBBBBBBBBBBBBBHHHPPBPHHHBHHHHBBAPPPPPPABBHPHBHHHPHPHBBBBA"
DATA "ABJJBBBBBBBBBBBBBBBBBJBJJJJJBBBJBJJBBBBBJJBJBBBBBJJBBBBJJJBBBBBBBBDBBBBBIAPPJPPJPPPABBBBBBBBBBBBBBBA"
DATA "AJBJJJBBBDJDJDDBJBJJDBBJJDJJJDJJJJJBJJDDJJJDDDJBDJJJJDDDBDDJJBJBJJBDBBBAIJJJJJJJJJJHABBBBBDBJDJBBDBA"
DATA "ABJJJJBJJDBJDDJBJDJJJBJDJJJDDBBBJDDJJDDJJJBBBBJJDDJBBBBJDJJJDBBBBBDB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AAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Re: [QUESTION] QB64 and program loading
«
Reply #6
on:
April 04, 2012, 07:16:34 am »
This is some simpler code, demonstrating the same , but no image,
Code:
DO ' main program loop
PRINT " This could be the splash image"
'///Print would need to be rplaced with the code to load the image, not print
PRINT "this and that"
_DELAY 5 '// sleep 3 (or what ever value you chose) could also be used
CLS
DEF SEG = 0 ' set to PEEK and POKE TIMER Ticks
POKE 550, 0 ' zero Timer tick
'DO
' loop code
PRINT "one more"
LOOP UNTIL PEEK(550) >= 0
DEF SEG ' reset segment to default
'CLS
PRINT "new program"
SLEEP
It was mentioned, that sleep might be a better choice,
http://www.qb64.net/forum/index.php?topic=5797.msg59751#msg59751
from Garry
«
Last Edit: April 04, 2012, 07:20:54 am by GarrisonRicketson
»
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Re: [QUESTION] QB64 and program loading
«
Reply #7
on:
April 04, 2012, 07:46:33 am »
Quote from: Draugr on April 02, 2012, 03:17:51 pm
Here is the basic idea of what I'm looking to achieve. The latter part I have working via a standard batch file, but the splash screen aspect isn't possible in a simple batch screen so I'm hoping QB64 might be able to do this.
Example:
run start.exe
Splash screen shows for 4 seconds then the exe performs the following code
cd game
dragons.exe
The program Dragons then launches.
On the CD GAME, or changeing Directorys, you should read up on this,..
Shell and changeing directorys
http://qb64.net/wiki/index.php?title=Special%3ASearch&search=Shell+CD&go=Go
--------------------
Quote
CHDIR
* '''A QB64 [[SHELL]] statement cannot currently use "CD " or "CHDIR " + path$ to change the directory using DOS.''' * [[SHELL]], [[FILES]]
3 KB (453 words) - 01:39, 26 January 2012
-------------------------
http://qb64.net/wiki/index.php?title=CHDIR
-----------------------
All though you can change directories, from what I have seen, often it leads to problems, and dose not work very well. ( just changeing to run a bat file, should not be a problem)
from Garry
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Re: [QUESTION] QB64 and program loading
«
Reply #8
on:
April 04, 2012, 11:28:27 pm »
I made a example, with a game, SMGBGE, written by Terrie Richie, it is to large to post the entire .bas here, so I have put it on drop box,
http://dl.dropbox.com/u/15387474/SMGBUG-qb64splash.bas.zip
This is only a .bas file , you will need to compile it with qb64. It displays the "spalsh image" (qb64 logo) about 3 seconds, then it starts the game, ..with no chdir, or separate programs,
You may want to check it out.
And this is a example of just the qb64 logo , as a "splash" image, embedded it the .bas.
http://dl.dropbox.com/u/15387474/qb64splash.bas.zip
«
Last Edit: April 05, 2012, 12:14:54 am by GarrisonRicketson
»
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
GarrisonRicketson
Admin
Administrator
Hero Member
Posts: 583
Re: [QUESTION] QB64 and program loading
«
Reply #9
on:
April 07, 2012, 04:33:39 pm »
This has been started in the QB64 Samples, at qb64.net
http://www.qb64.net/forum/index.php?topic=5816.0
The code has been improved and developed into a very easy to use utility, that now can create a "splash Image" using any type of image file, or file,..
It is well worth checking out. I posted my example, (the zip file) first, and both Terrie Richie, and Galleon, shortened up , and improved the code, considerably, the "program" or utility now fits easily into the code window, and simpley can be copied/pasted, to the qb64 Ide, (editor) or any text editor.
from Garry
Report Spam
Logged
From Garry
http://www.garryricketsonartworks.com/SMF
http://www.garryricketsonartworks.com/phpbbforum
http://www.garryricketsonartworks.org
http://www.garryspages.webs.com
http://wittywittywhatisthat.freesmfhosting.com/index.php
http://www.garryricketsonartworks.com/FluxBB
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> Useful Information ,Rules,FAQs,LINKS,etc.
===> INTRODUCE Yourself
=> General QB64 Forum
=> MS DOS, FREE DOS, ANY DOS
-----------------------------
QB64 lessons and tutorials,Games
-----------------------------
=> Lesson Disussion
=> Weekly Lesson
=> Games
-----------------------------
TUTORIALS
-----------------------------
=> QB64 Tutorials
=> Text Adventure
=> QBasic Tutorials
=> Other Tutorials
-----------------------------
UNSEENS GDK+SFML Librarys
-----------------------------
=> Discussions on GDK+SFML
=> GDK+SFML Demos, and projects
-----------------------------
DEMOS
-----------------------------
=> Working QB64 Demos
=> QB64 Games
=> QB64 Programs You Are Proud Of.
=> Function + SUB Club
-----------------------------
OFF TOPIC,and Off The wall
-----------------------------
=> OffTopic and Off the Wall
Powered by
EzPortal
Loading...