Posted: Tue Dec 20, 2011 7:35 pm Post subject: Cant get Message to appear
What is it you are trying to achieve?
I am trying to show the message "Merry christmas" one letter at a time
What is the problem you are having?
the problem is, it doesnt show up! at the end, it just pauses and then ALL the letters show up, not one of them at a time.
Describe what you have tried to solve this problem
I made this code on a new window and it was fine, all the letters showed up 1 at a time, but when pasted it on this code, it didnt work.
Turing:
%Name: Colin Lam 2011 %Class: ICS2O1-01 Seat #11 %Name of Program: pixel graphics %Pixel graphics animation that involves wireless devices % % marking scheme Pixel assigment % /10 mark for Initials Eg. GM % /10 animation eg. snow, tree moving, snowman dancing % /10 structures eg house, sled, stars, presents % /10 comments % /25 creativity( % /10 storyboard %Total out of ____ /65
var Box_y, Box_y2, count2 :int:=0%Moving the ipod touch Variables var count :int:=0 var Box1 :int:=380 var Box2 :int:=400 var Box3 :int:=780 var Box4 :int:=800 var Box5 :int:=300 var Box6 :int:=325 var handx :int:=400 var handx2 :int:=550 var handy :int:=200 var handy2 :int:= -200
Box_y :=10
Box_y2 :=40 var x3 :array1.. 7ofint:=init(746, 746, 778, 777, 746, 759, 777) var y3 :array1.. 7ofint:=init(155, 132, 132, 154, 154, 145, 154) % This polygon was created using Gurjant Kalsi's Polygon Generator var x2 :array1.. 7ofint:=init(246, 246, 278, 277, 246, 259, 277) var y2 :array1.. 7ofint:=init(155, 132, 132, 154, 154, 145, 154) % This polygon was created using Gurjant Kalsi's Polygon Generator var counter :int:=1 var roofx :array1.. 4ofint:=init(10, 150, 341, 450) var roofy :array1.. 4ofint:=init(300, 450, 450, 300) var count1 :int:=1
%Snowflake Animation const FlakesFalling :=400 var FlakeX :array1.. FlakesFalling ofint var FlakeY :array1.. FlakesFalling ofint for Flake :1.. FlakesFalling
FlakeX (Flake):= Rand.Int (0, maxx)
FlakeY (Flake):= Rand.Int (0, maxy) endfor
Posted: Tue Dec 20, 2011 8:11 pm Post subject: RE:Cant get Message to appear
I thought you learned about procedures lol.
colinlamm
Posted: Tue Dec 20, 2011 8:40 pm Post subject: Re: RE:Cant get Message to appear
Aange10 @ Tue Dec 20, 2011 8:11 pm wrote:
I thought you learned about procedures lol.
Dont procedures basically allows u to copy whatever u put in the procedure in another place so that u dont have to copy all the things again? Like instead of copy and pasting a whole bunch of coding a bunch of times, i just put that coding in a procedure (random name) and whenever i wanna use that code again i just gotta write (random name)? o_O
colinlamm
Posted: Tue Dec 20, 2011 8:42 pm Post subject: Re: RE:Cant get Message to appear
Tony @ Tue Dec 20, 2011 7:46 pm wrote:
Well that's a wall of code that I'm not going to read past 2 lines, though that is enough to address your issue.
You are obviously copy-pasting some parts of code from somewhere else. What does
Im pretty sure the setscreen ("graphics:800;600") sets the run screen to a resolution of 800 by 600 and View.Set basically makes the animation better? (at least thats what i was told by my teacher)
colinlamm
Posted: Tue Dec 20, 2011 8:44 pm Post subject: Re: Cant get Message to appear
The things i copied was the snow code, and the house :3 i did the rest by myself which makes me happy ^^
ProgrammingFun
Posted: Tue Dec 20, 2011 8:46 pm Post subject: Re: Cant get Message to appear
colinlamm @ Tue Dec 20, 2011 8:44 pm wrote:
The things i copied was the snow code, and the house :3 i did the rest by myself which makes me happy ^^
Doing it all yourself will make you more happy
Anyways, you are essentially telling the program to output graphics and then telling it now to in those two lines.
setscreen and View.Set are the same thing essentially.
Tony
Posted: Tue Dec 20, 2011 8:49 pm Post subject: Re: RE:Cant get Message to appear
colinlamm @ Tue Dec 20, 2011 8:42 pm wrote:
View.Set basically makes the animation better? (at least thats what i was told by my teacher)
Kind of... it makes animations better by not making drawings appear on screen until later.
Posted: Tue Dec 20, 2011 8:50 pm Post subject: Re: Cant get Message to appear
ProgrammingFun @ Tue Dec 20, 2011 8:46 pm wrote:
colinlamm @ Tue Dec 20, 2011 8:44 pm wrote:
The things i copied was the snow code, and the house :3 i did the rest by myself which makes me happy ^^
Doing it all yourself will make you more happy
Anyways, you are essentially telling the program to output graphics and then telling it now to in those two lines.
setscreen and View.Set are the same thing essentially.
O_o any ideas on how to get the "MERRY CHRISTMAS" thingy to appear?
Aange10
Posted: Tue Dec 20, 2011 8:53 pm Post subject: Re: RE:Cant get Message to appear
Tony @ 20/12/2011, 7:49 pm wrote:
colinlamm @ Tue Dec 20, 2011 8:42 pm wrote:
View.Set basically makes the animation better? (at least thats what i was told by my teacher)
Kind of... it makes animations better by not making drawings appear on screen until later.
View.Set doesn't do this. View.Set ("offscreenonly") does. View.Set and setscreen are synonymous, meaning both of them will do the same thing
Posted: Tue Dec 20, 2011 9:05 pm Post subject: Re: Cant get Message to appear
ANYWAYS... So my friend told me that instead he did a put "SKDHASOIFHA" kinda thing, and used a delay. Using put makes the font ugly, so is it possible to make the letters appear one at a time for this code? Cus i made it in a new document and it worked fine on that, but when i added it to this code it got all slow o_o
Aange10
Posted: Tue Dec 20, 2011 10:01 pm Post subject: RE:Cant get Message to appear
Quote:
ANYWAYS...
Everything being said is something you should learn from.
crossley7
Posted: Tue Dec 20, 2011 10:29 pm Post subject: RE:Cant get Message to appear
What your issue is, is that you are having the letters printed to a buffer and then when the code runs through View.Update, it displays everything on the screen and so your text all appears at the same time.
I am putting it bluntly so that you can see exactly what you need to fix. I have not looked at your code extensively, nor do I intend to as it is uglier than my code is and I never look at my programs after finishing them for fear of hurting my mind trying to understand them. (Something I am working to fix)
Now you should be able to at least test a few solutions and figure it out.
On a side note, does anyone know if OpenTuring allows a variable in the first parameter for Font.Draw? That is something that has always frustrated me about Turing graphics that you have to hard code in Font.Draw
Tony
Posted: Tue Dec 20, 2011 10:34 pm Post subject: RE:Cant get Message to appear
@crossley7
code:
var variable : string := "lol wut?"
var font : int := Font.New("whatever:12")
Font.Draw(variable, 100, 100, font, black)