Object on top of another and text box
Author |
Message |
iproballer
|
Posted: Sat Jun 05, 2010 10:52 pm Post subject: Object on top of another and text box |
|
|
What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>
What is the problem you are having?
<Answer Here>
Describe what you have tried to solve this problem
<Answer Here>
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>
Turing: |
<Add your code here>
|
Please specify what version of Turing you are using
<Answer Here> |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
iproballer
|
Posted: Sat Jun 05, 2010 10:54 pm Post subject: Re: Object on top of another and text box |
|
|
Sorry guys I couldnt figure out the new thread format so ill post my question here. Hi guys, well im tryigng to put an object on top of another (drew a fillbox and wat to put another fillbox on top of it) but it does not appear as its hidden behind it or something. And also when I add text
locate(x,y)
put"Hello"
Why is there a small rectangle surrounding the text and going all the way through the other end of the screen and how can I get rid of it? Thanks in advnace, im new to the forum and it looks very helpful ![Smile Smile](http://compsci.ca/v3/images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
Cezna
![](http://compsci.ca/v3/uploads/user_avatars/9406831824c097251d4bb4.gif)
|
Posted: Sun Jun 06, 2010 11:03 am Post subject: Re: Object on top of another and text box |
|
|
This rectangle is what is showing of the background.
When you use put, it clears the entire line you are putting on.
You get rid of this, type:
As for the boxes, I would guess you are drawing them in the wrong order, or they are the same size, but I would have to see your code to give you any meaningful advice.
Instead of using put, try using Font.Draw, which uses this syntax:
code: |
Font.Draw ("Hello", x position, y position, fontstyle, colour)
|
You declare font styles with this syntax:
code: |
var fontstyle : int
fontstyle := Font.New ("Arial:40x20:bold,italic,underline")
|
or
code: |
var fontstyle := Font.New ("Sans Serif:40:bold")
|
Using Font.Draw eliminates the showing of the background, gives you more precise control over positioning, gives you the control over the style and size of the text, and many other benefits.
Font.Draw can make your program look prettier, but for technical applications, it is sometimes best to use put. |
|
|
|
|
![](images/spacer.gif) |
|
|