printing colored s

BlitzMax Forums/BlitzMax Beginners Area/printing colored s

drnmr(Posted 2005) [#1]
i made a program that u can type in, but for some reason it wont let me type colored s. i made a separate program that simply prints green s and it says the letter s does not exist???


Perturbatio(Posted 2005) [#2]
you need to expand on your bug report some more, perhaps with some example code.

Notes on posting bugs


drnmr(Posted 2005) [#3]
example code:

mx=(mousex()+10)
if keyhit(key_s)
setcolor 0,255,0
drawtext "S" mousex(),mousey()
movemouse mx,mousey()
endif

Note:The problem is not that mx isn't working, i did this with all letters of the alphabet and it worked with them


Perturbatio(Posted 2005) [#4]
Graphics 640,480,0,0

While Not KeyDown(KEY_ESCAPE)

Cls

mx=(MouseX()+10)

If KeyDown(key_s)
SetColor 0,255,0
DrawText "S", MouseX(),MouseY()
MoveMouse mx,MouseY()
EndIf

Flip

FlushMem
Wend

End




drnmr(Posted 2005) [#5]
it ONLY doesnt work with s, all the other letters work


drnmr(Posted 2005) [#6]
(i'm already using flip)


Perturbatio(Posted 2005) [#7]
Drawing S works fine for me.

*EDIT*
The code I posted works for me.

Make sure you have the latest version


drnmr(Posted 2005) [#8]
i dont know what the problem for me is, but i did exactly what you did and it didn't work


Perturbatio(Posted 2005) [#9]
post the code *exactly* as it is in your source file.


xlsior(Posted 2005) [#10]
Try this, Drnmr:

Print key_s

Does it print the correct code (83) on your computer, or something else altogether? If you see something different, it's possible that the internal variable definitions somehow got messed up on your computer?


FlameDuck(Posted 2005) [#11]
Also - make sure there is actually an "s" in the font you're using.


drnmr(Posted 2005) [#12]
yes, i see 83, but how do i change the font?


xlsior(Posted 2005) [#13]
Using the LoadImageFont command, although if you haven't switched to a different font then you're using the default font which 'should' have the entire alphabet.

What happend when you change the code from one of your other letters to print the 's'?

e.g.
mx=(mousex()+10)
if keyhit(key_e)
setcolor 0,255,0
drawtext "S" mousex(),mousey()
movemouse mx,mousey()
endif


Which should print an 's' if you hit the letter 'e'?
Or what about:

mx=(mousex()+10)
if keyhit(key_s)
setcolor 0,255,0
drawtext "E" mousex(),mousey()
movemouse mx,mousey()
endif


Which should draw an 'E' when you press the 'S'?
Do either one of those work, or do they fail as well?


tonyg(Posted 2005) [#14]
So how did you fix it


drnmr(Posted 2005) [#15]
i already used the key s in a saving function that didn't work and i forgot about, and it tried to save instead of draw s.