Computer Science Canada

Put statements.

Author:  Michael Hasson [ Mon Jun 08, 2009 3:53 pm ]
Post subject:  Put statements.

What is it you are trying to achieve?
How do i place a put statement on top of a drawfill box?

Author:  wallc++ [ Mon Jun 08, 2009 3:59 pm ]
Post subject:  Re: Put statements.

do you mean like putting text above a box?

Author:  Michael Hasson [ Mon Jun 08, 2009 4:00 pm ]
Post subject:  Re: Put statements.

I mean right on top of it.

Author:  BigBear [ Mon Jun 08, 2009 4:23 pm ]
Post subject:  RE:Put statements.

look into locatexy

Author:  Tony [ Mon Jun 08, 2009 4:27 pm ]
Post subject:  RE:Put statements.

put will draw a box of background colour behind itself. You might be looking for Font.Draw

Author:  BigBear [ Mon Jun 08, 2009 4:30 pm ]
Post subject:  RE:Put statements.

or colorback

Author:  Kharybdis [ Mon Jun 08, 2009 4:41 pm ]
Post subject:  RE:Put statements.

Turing:

procedure DrawFont (name : string, input : string, locationx, locationy : int)
    var font : int %font name
    %Example for description of name : "Papyrus:10:Bold"
    font := Font.New (name) %font is assigned to the name given in the parameters
    assert font > 0 %checks if the font exists
    Font.Draw (input, locationx, locationy, font, green) %draws what i want, in position locationx, locationy, with my desired font, also in green.
    Font.Free (font) %frees the font
end DrawFont



example of how to call the procedure:
Turing:
DrawFont("Papyrus:10:Bold","i am drawing this onto the screen!",300,300


this is just an example of how one would utlize Font.Draw ...

Author:  BigBear [ Mon Jun 08, 2009 4:55 pm ]
Post subject:  RE:Put statements.

You wouldn't need an assert statement because if the font doesn't exist turing will use arial

Author:  Kharybdis [ Mon Jun 08, 2009 7:37 pm ]
Post subject:  Re: RE:Put statements.

BigBear @ Mon Jun 08, 2009 4:55 pm wrote:
You wouldn't need an assert statement because if the font doesn't exist turing will use arial


and what if the computer that the program is being run on doesn't have arial installed? picky, but ... hey Razz

Author:  Dusk Eagle [ Mon Jun 08, 2009 10:40 pm ]
Post subject:  Re: Put statements.

I don't have the Arial font yet it still works for me Razz ... I believe Turing will just default to whatever font you are using in its text window if a specified font is not installed.


: