Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Text overlapping picture !!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Angel




PostPosted: Sat Jan 03, 2004 5:36 pm   Post subject: Text overlapping picture !!!

Ok, I have another problem.

code:
cls

Pic.Draw (pic21, 600, 50, picMerge)

var font2 := Font.New ("haettenschweiler:14")
var name : string
locate (2, 5)
Draw.Text ("Hello, welcome to an interactive MOVIE QUIZ presented by Marta and Nik!", 150, 450, font2, 13)
locate (8, 1)
delay (2000)
colour (13)
put "Please enter your name: " ..
get name : *
locate (11, 1)
delay (800)

var choice : int
put "GREAT! Now ", name, ", what kind of quiz would you like to do?"
put ""
put "1. Actors/Actresses"
put "2. Movie Titles"
put ""
put "Please select the number of your selection:  " ..


The problem is, that you see how there's a picture there? Well when the text shows up, the picture is overlapped and it's cut off. Is there any way to fix that? Crying or Very sad
Sponsor
Sponsor
Sponsor
sponsor
Ashkan




PostPosted: Sat Jan 03, 2004 7:48 pm   Post subject: reply

well i can't see your picture behind but it doesnt matter i know what ya mean however i havn't yet come up with something that can make the back color of text to somethhing transparent but maybe you can play a little trick like make the exact back color behind your text as the back ground with this code Text.ColorBack ( red ) which you have to put before the line put "Please enter your name: " .. and get name : * so that the back color matches with the background ... but if you have some picture which has all colours mixed up this is not really useful but you can play tricks and edit your picture at those parts and make them having a plain colour and use the same colour as the back color for your text
Boarder16




PostPosted: Sat Jan 03, 2004 8:40 pm   Post subject: (No subject)

by the sounding of ur programing code ur a newbie and in a S>>L>>>O>>W computer science class lol, i no i am in one now, but were way ahead.. u shoudl sue Font.Draw's instead...they draw the text ontop the picture no problem... inever use teh draw.text things u use... look in your turing reference for teh perameters.... it should work fine then...
AsianSensation




PostPosted: Sat Jan 03, 2004 11:02 pm   Post subject: (No subject)

Boarder16 wrote:
u shoudl sue Font.Draw's instead...they draw the text ontop the picture no problem... inever use teh draw.text things u use...


dude, Draw.Text and Font.Draw are exactly the same thing
santabruzer




PostPosted: Sun Jan 04, 2004 12:52 am   Post subject: (No subject)

ha ha.. so true... it's like Text.Locate and locate
Angel




PostPosted: Sun Jan 04, 2004 3:22 pm   Post subject: (No subject)

Hmm... well you've all got me comfused! Too bad I can't really manipulate the colours in the picture... it just won't work. I guess I'll have to find a smaller picture or something that won't be overlapped... (which by the way TOTALLY sucks!)
But wait! I know I've done it before... using Draw.Text or something. Hmm... Maybe I'll figure it out after all!
Angel




PostPosted: Sun Jan 04, 2004 3:47 pm   Post subject: (No subject)

Here's what I was thinking:

code:
locate (8, 1)
delay (2000)
colour (13)
put "Please enter your name:  " ..
get name : *

locate (11, 1)
delay (800)
var choice : int
put "GREAT! Now ", name, ", what kind of quiz would you like to do?"
put ""
put "1. Actors/Actresses"
put "2. Movie Titles"
put ""
put "Please select the number of your selection:  " ..
get choice


I want to take this code and instead of using the "put" command, I can use Draw.Text so that the text just overlaps the picture, kinda like in this code:

code:
var word := "W E L C O M E  T O  M O V I E  T R I V I A"
var height := 24
var font1 := Font.New ("raavi:" + intstr (height))
var x := (maxx - Font.Width (word, font1)) div 2
var y := (maxy - height) div 2
for rep : 1 .. length (word)
    delay (100)
    Draw.FillBox (x, y, x + Font.Width (word (rep), font1), y + height, black)
    Font.Draw (word (rep), x, y, font1, 13)
    x += (Font.Width (word (rep), font1))
end for


(Which I still don't understand how it works.) But anyway, the only problem is that I don't know how to work in the "get" command and stuff. I mean I want the layout to stay the same but I don't know how to place commands and what commands to place since I have no idea how the code works in the first place, so guys can you please put comments when giving a code because I'm really new at this and I wanna understand how this stuff works. Thanks.
Angel




PostPosted: Sun Jan 04, 2004 5:03 pm   Post subject: (No subject)

I figured it out!!!

code:
var font := Font.New ("courier:10")
var font2 := Font.New ("haettenschweiler:14")
var name : string
locate (2, 5)
Draw.Text ("Hello, welcome to an interactive MOVIE QUIZ presented by Marta and Nik!", 150, 450, font2, 13)
locate (6, 1)
delay (700)
colour (13)
put "Please enter your name:  " ..
get name : *
put ""

delay (800)
var choice : int
put "GREAT! Now ", name, ", what kind of quiz would you like to do?"
put ""
Draw.Text ("1. Actors/Actresses", 1, 287, font, 13)
Draw.Text ("2. Movie Titles", 1, 267, font, 13)
put ""
Draw.Text ("Please type the number of your selection. Then press <<ENTER>>:  ", 1, 205, font, 13)
locate (15, 65)
get choice


I finally accomplished what I've been trying to do and now that text that I want, overlaps the picture!!! Finally, something i accomplished on my own. I'm proud Very Happy !
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: