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.

Newcomers DBPro Corner / whats up with the color?

Author
Message
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 7th Jul 2004 12:45
whats wrong i know i ask a lot of questions but this is screwed. theres no color to the text.
Rem Project: Fallen Destiny
Rem Created: 7/2/2004 12:49:42 PM

Rem ***** Main Source File *****
load image "fallen destiny title.jpg",1
load music "MeetGodOfLife.mid",1
play music 1
paste image 1,140,110
hide mouse
set text font "arial"
select SmallIntergerVariable
case 1 : center text 200,400,"new game" : endcase
case 2 : center text 330,400,"load game" : endcase
case 3 : center text 450,400,"exit" : endcase
endselect
do
if escapekey()=1 then end
loop

jacob warren
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 7th Jul 2004 12:57 Edited at: 7th Jul 2004 13:03
use the ink command + the rgb(r,g,b) command


ink rgb(r,g,b),0

where r is your red component (0-255)
where g is yor green component (0-255)
where b is your blue component (0-255)


From the html built-in help file
Quote: "INK
This command will set the current ink color using the specified color value. color values range from 0 to
over 16 million, that represent every combination of red, green and blue to make up the final color. You
can use the RGB command to make the generation of the color value straight forward. The parameter
should be specified using integer values.

SYNTAX
INK Foreground Color,Background Color


RGB
This command will return the final color value of a combination of red, green and blue intensities. For each
of the Red, Green and Blue components you must enter a value between 0 and 255. All zero will return a
color value that represents black. All 255 will return a color value that represents white. By setting the Red
component to 255 and the rest to zero, the command will return a color value that represents red. The
parameters should be specified using integer values.

SYNTAX
Return DWORD=RGB(Red Value,Green Value,Blue Value)"


Just note: ink calls are sssslllloooowwwww! Later down the road you will want to use image fonts, sprite fonts, and write your own faster text routines or a 3rd party dll.

~zen


gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 7th Jul 2004 13:03
but now it says dword name is not valid at line 11

jacob warren
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 7th Jul 2004 13:38 Edited at: 7th Jul 2004 13:45
you did replace the r,g,b with numbers right?

like for purple:

ink rgb(255,0,255),1

Nevermind that.
================================================
Why do you have SmallIntegerVariable
in your select statement

you need to give it a variabel that has a value.
Which in your case would have to be an integer that
is equal to either 1 2 or 3

Also,
In your example at this point you don't need a loop.
escapekey to end program is avaialble by default

to stop your program from exiting, at the point it's at now
remove the DO escapekey()=1 line and LOOP.
and replace them with wait key

~zen


gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 8th Jul 2004 01:19
ok

jacob warren
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 10th Jul 2004 06:30
now it says could not determine parameter type of 'Return DWORD' at line 12

jacob warren
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 10th Jul 2004 08:05
Please, post your source again, with the changes you made.


gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 10th Jul 2004 09:57
load image "fallen destiny title.jpg",1
load music "meetgodoflife.mid",1
play music 1
paste image 1 140,110
hide mouse
set text font "arial"
select smallintergervariable
case 1 :ink return dword= rgb(255,0,255),0 : center text 200,400,"New Game" : endcase
case 2 : ink return dword=rgb(255,0,255),0 : center text 330,400,"Load Game" : endcase
case 3 : ink return dword=rgb(255,0,255),0 : center text 450,400,"exit" : endcase
endselect

jacob warren
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 10th Jul 2004 10:42
Huh??

Where'd you get that "return dword" stuff??

The comand is INK RGB(255, 255, 255),0 for WHITE on BLACK, INK RGB(255, 0, 255), 0 for PURPLE on BLACK, or INK RGB(255, 255, 0), RGB(0, 0, 255) for YELLOW on BLUE.

Or, in your case;

case 1: ink rgb(255,0,255),0 : center text 200,400,"New Game" : endcase

and so on...

Any truly great code should be indisguishable from magic.
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 10th Jul 2004 11:23
what the heck do you mean?

jacob warren
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 10th Jul 2004 12:20 Edited at: 10th Jul 2004 13:38
gothboy 101,

you still have "smallintegervariable" in the code you posted that needs to be changed. like this for example

load image "fallen destiny title.jpg",1
load music "meetgodoflife.mid",1
play music 1
paste image 1 140,110
hide mouse
set text font "arial"
choice=1
select choice
case 1 :ink return dword= rgb(255,0,255),0 : center text 200,400,"New Game" : endcase
case 2 : ink return dword=rgb(255,0,255),0 : center text 330,400,"Load Game" : endcase
case 3 : ink return dword=rgb(255,0,255),0 : center text 450,400,"exit" : endcase
endselect

Now in your program you should use the input command , or use a key state outine, to get a choice from the user. This way the user can choose either 1,2, or 3 for the calue of choice.

eg
inputroutine:
print "Enter 1, 2, or 3"
input choice
if choice=1 or choice=2 or choice=3 return
gosub inputroutine

you can also look at the key state commands to check for keypresses in a real-time loop.

~zen


SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 10th Jul 2004 13:14 Edited at: 10th Jul 2004 13:26
Sigh... okay, I bow to the absurd. [edit: the previous I made had too much attitude in it, so I'm re-posting this.]



S.

If you expect to see ALL THREE lines show up -- then you are not understanding the select command! It only performs whatever line matches the condition given, so if you want to see all three lines try;



After the input, the SELECT CHOICE will be the actions to be taken, as in;



s.

Any truly great code should be indisguishable from magic.
gothboy 101
20
Years of Service
User Offline
Joined: 31st May 2004
Location: Watonga, ok, usa
Posted: 11th Jul 2004 12:19
it still doesn't work!

Chaos Games
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 11th Jul 2004 20:06
here is an example of case select if your getting a bit confused.



If no-one gives your an answer to a question you have asked, consider:- Is your question clear.- Did you ask nicely.- Are you showing any effort to solve the problem yourself

Login to post a reply

Server time is: 2024-09-22 16:20:42
Your offset time is: 2024-09-22 16:20:42