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

Username:   Password: 
 RegisterRegister   
 [Help] Picture issue
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
tjmoore1993




PostPosted: Thu Apr 02, 2009 5:06 pm   Post subject: [Help] Picture issue

Hello, I've made quite a few posts to receive help and have received some nice answers that help a lot. I have been learning turing for several days and know how to do a lot of things but I am not to good around a few categories.

Anyways I seen a guide on implementing a picture to your application. I've got the picture added and it launches when I want it to through a procedure.

Problem :
The picture is a "menu_bar" and I want text to display on the "Image" but when I try to use this

Turing:

locatexy (1, 1)
put variable


my variable goes where it is suppose to go but the image that I want to use for the "menu_bar" moves up an x value.

Question :
Is there some sort of way to make it so that the "menu_bar" does not move and it stays on the bottum so other things can display on it?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Apr 02, 2009 5:21 pm   Post subject: RE:[Help] Picture issue

You are mixing "graphics mode" with "text mode", so that could lead to problems. The put statement will also draw a solid background behind the text, so that wouldn't work with images.

You are probably looking for Font.Draw
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
tjmoore1993




PostPosted: Thu Apr 02, 2009 6:24 pm   Post subject: RE:[Help] Picture issue

Thanks but there is still a problem. I have variables that are integers that I want written but I get an argument unless they are strings.
DemonWasp




PostPosted: Thu Apr 02, 2009 9:24 pm   Post subject: RE:[Help] Picture issue

You want to convert an int to a string with intstr()
Dusk Eagle




PostPosted: Fri Apr 03, 2009 12:24 am   Post subject: Re: [Help] Picture issue

You can even do something fancy like this with intstr:
Turing:

var font := Font.New ("serif:20")
var score : int := 10
Font.Draw ("Your score is " + intstr(score), 50, 30, font, red)


The final line is what's important. There are two things to notice here. The first is the intstr(score). The intstr command, as DemonWasp said, is used to convert an int to a string. Although you could do something like:
Turing:

var score : int := 10
var score_as_string := intstr(score)

which do you find easier?

The second thing to notice is the + sign. The + is used to combine to different strings together into one. So, for instance, we could do the following:
Turing:

var string1 : string := "Hello"
var string2 : string := "World"
var string3 : string := string1+string2
Font.Draw (string3, yada-yada-yada)


Combine these techniques and you'll be a Turing Master in no time! Laughing
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  [ 5 Posts ]
Jump to:   


Style:  
Search: