
-----------------------------------
Joe Keller
Fri Jan 20, 2012 8:39 pm

Font Draw
-----------------------------------
What is it you are trying to achieve?
I want to draw the font with the product number (im making the price is right game),
i will be like
Product 1
then show it, and so on

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)



var productnumb := 0

loop
productnumb:= productnumb + 1
var font8 : int
    font8 := Font.New ("Arial:20")
Font.Draw ("Product" productnumb, 230, 381, font8, 7) %I want to put the number of the product, and not have to manually type product one, product two, product 3
exit when productnumb = 3
end loop




-----------------------------------
Alex C.
Fri Jan 20, 2012 8:59 pm

RE:Font Draw
-----------------------------------
well your produc tnumber is an int, and Font.Draw can only accept string and char types of variable...

look into your holtsoft doc to find the convert "int to string" command

-----------------------------------
Joe Keller
Fri Jan 20, 2012 9:02 pm

RE:Font Draw
-----------------------------------
Is there any other way of doing it than this specific code? so i can write a number i can alter aswell as text

-----------------------------------
Alex C.
Fri Jan 20, 2012 9:09 pm

RE:Font Draw
-----------------------------------
mmmmm.... im not sure

-----------------------------------
Dreadnought
Sat Jan 21, 2012 12:38 am

Re: Font Draw
-----------------------------------
I think Is there any other way of doing it than this specific code? so i can write a number i can alter aswell as text
I think you want to have both text and a variable together in the string you draw. This is very easy once you convert the integer (product) into a string.

You just do regular string concatenation.Font.Draw (string1 + string2 + etc. , /* other arguments*/)
% In your case
Font.Draw ("Product" +  (product), 230, 381, font8, 7)

I'm gonna stick with Alex C.'s idea of not telling you the name of the function to convert an integer into a string, but I'll give you hint, it starts with "int" (just the letters not the quotation marks).

Good luck.

-----------------------------------
copthesaint
Sat Jan 21, 2012 10:03 am

RE:Font Draw
-----------------------------------
This results int to string
intstr (x  : int) : string
this results  string to int
strint (s : string) : int
this results real to string
realstr (x : real, 0) : string

-----------------------------------
Alex C.
Sat Jan 21, 2012 2:30 pm

RE:Font Draw
-----------------------------------
@Dreadnought

Hey! i actually forgot that function!
your soul shall burn forever!!! :evil:
just kidding! lol :P
