Posted: Sun Mar 24, 2013 2:04 pm Post subject: ***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing)***
The Picture Helper
Irobots
A lot of people have been asking me about how to draw efficiently in turing with all the codes for circles, lines, ovals etc. and in truth, I had the same problem.
So I spent some time figuring out how to make a nice type of program that would allow users to make shapes much easier then they would normally and then get
the code for those shapes so that they could incorporate them in their turing programs.
The code that I made called The Picture Helper allows you to make circles, lines, arcs, fills and names on the run window of my program and then you would be able
to get the code in a file called my_projects_coordinates.t which would essentially replicate what was made on my programs run window. The reason I made my program create a
new file to put the code in is because you can not copy code through ctrl+C of off a turing run window so that way it would be quicker to get all of your code.
Since my classmates have been very interested in my program and find it easy to use, I have chosen to put the full version of my program on here and will constantly update
it for new features and shapes.
Note that the folder which the program is in when run gets 2 new files created. One is My_projects_coordinate.t which has the program of all the shapes you had made. The other is Delete_me. I think that it is fairly self explanatory as to what you should do with that file!
Please comment as to what you like, what I should change/add and I would appreciate code changes to improve functionality!
Posted: Sun Mar 24, 2013 2:51 pm Post subject: RE:***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing)
[Tony]I've moved it into Turing Submissions[/Tony]
Just a note, this is a submission, not a tutorial for future reference; theres another sectionyou can post stuff like this.
irobots
Posted: Sun Mar 24, 2013 2:55 pm Post subject: Re: ***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing
I am sorry about the incorrect placement of my code as I am a bit of a newbie. I will make sure to put my codes in the correct section next time!
Irobots
Raknarg
Posted: Sun Mar 24, 2013 3:07 pm Post subject: RE:***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing)
It's fine. A couple things I noticed right away:
1) the screen flashes annoyingly. This is a simple fix using setscreen ("offscreenonly") and View.Update, and there are countless posts regarding this issue. Look it up, if you wish.
2) The Arc feature is off; sometimes the up or down direction of the arc is in the wrong direction. When the mouse is to the right of the arc, the arc is always facing down. When the mouse is left, the arc is always facing up. The direction of the arc should be affected by the y, and the width of it should be affected by the x, not a mixture, otherwise you get a weird interface.
3) It's hard to explain, but lets say I make a circle, and fill it with orange. Then lets say I want to draw a line over the circle. If I wave the line around the circle before I place it, it leaves a kind of trail across the non red area.
Also, I wouldn't use red as a background colour. I would use grey or white instead, it's easier to see.
irobots
Posted: Sun Mar 24, 2013 3:23 pm Post subject: Re: ***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing
Sorry about the inconvenience the program is giving you.
Your first problem-I have no clue where it came from as nothing happened of the sort on my computer or the schools computer. It may be that your screen is different or there are too many processes in the background. Feel free to edit and put the offscreenonly function where seems fit
Your second problem is not really a problem. I wanted to do it that way and many classmates also preferred the arc function to work that way. You can go ahead and fix the problem but I don't see it will do much justice in my point of view.
I understand you have a problem with the streaks of red on the filled images. The problem would be that if I recreated the image every time when you are moving a line across it, it would become very laggy and wouldn't work very well.
I personally prefer the red background-as I made it that way. Feel free to change the colour. One of the reasons I made it that way is so the grid stands out and doesnt interfere with the drawings. For instance if the background was white then the grid would be black and then it would be hard to see the black outline of the images.
Thank you for the suggestions and bugs which you have found. It will help others and myself make a better program! I hope you continue to point out features which should be fixed or edited
Irobots
Raknarg
Posted: Sun Mar 24, 2013 3:43 pm Post subject: RE:***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing)
The flashing is inherant to Turing, because of how it works. It does every draw function directly to the screen whever you call something. So if you draw a line, a circle and then clear the screen, you will see a line being drawn, a circle being drawn and then the screen being cleared. With View.Update and offscreenonly, it instead draws everything to an off-screen buffer.
This way whatever is drawn on the screen is only shown when View.Update is called, and stops the screen from flashing. However it can be slower.
The program shouldn't be laggy. It's only a matter of redrawing a few shapes each frame. If it's lagging just from that, you're probably doing something wrong.
As for the grid, you could make a white background, and light gray lines that don't interfere but are still visible. It's your program though, so to each their own.
Raknarg
Posted: Sun Mar 24, 2013 3:55 pm Post subject: RE:***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing)
anyways its still a neat program
irobots
Posted: Sun Mar 24, 2013 3:56 pm Post subject: Re: ***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing
The problem was that I did not want it to be slower which is why I made it the way it was. I understand what you mean through veiw.update but that is not necessary in my programs case. The reason is that my program only clears the screen when you finish drawing a shape. (put one end of the shape, drag, put another end of the shape, cls, restart). There is absolutely no reason it should flicker as it only clears when you finish making a shape. The way it clears the image when you are dragging it is by putting the same image but in red which is why you see the streaks on a filled image. I guess we will have to wait what other users say about if the flickering occurs and if anyone finds a solution for it if it does occur.
I am sorry that I could not figure out why the program seems to not work the way it should for you.
My only suggestion is to take out parts of the program and see what may be at fault.
Irobots
Sponsor Sponsor
irobots
Posted: Sun Mar 24, 2013 4:21 pm Post subject: Re: ***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing
****An update to the instructions:****
If you dont like the location of the dot when creating an image then press any two letters and ENTER. There are no redo's such as CTRL+Z works so once you make a shape you can't delete it. my suggestion is that if you make a bad shape, make a name under it saying "Delete_shape_above". Then you could check the outputed code from the program and delete any of the code with such a name under it.
Irobots
Raknarg
Posted: Sun Mar 24, 2013 4:35 pm Post subject: RE:***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing)
You should create an undo procedure, that would be useful
irobots
Posted: Sun Mar 24, 2013 4:40 pm Post subject: Re: ***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing
I completely agree with you and so do many of my classmates!
I am currently working on it with the seek function and it is proving to be fairly difficult as I have to edit 2 files with different attributes.
By the 2 files I mean "My_projects_coordinates.t" and "Delete_me". The first stores the code to remake the image on a new turing files
and the second stores information to remake the information on my program every time it clears.
Irobots
Raknarg
Posted: Sun Mar 24, 2013 4:56 pm Post subject: RE:***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing)
Well it shouldn't be too hard, it all depends on how your program is set up.
First of all, how do you store each shape or command? Is it all stored in a text file as soon as it's made, or do you have a kind of list/array to keep track of it?
irobots
Posted: Sun Mar 24, 2013 5:05 pm Post subject: Re: ***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing
I keep track of all my shapes tracked in the file called "Delete_me" to be used when refreshing the window every time you complete a shape or fill. Open it with notepad to check out the format of all the information on it. Note that names are not stored on it. I understand that it is not too difficult. Just count the amount of entries in the file then seek one above that amount and delete it. I would appreciate if you could edit that part in if you do not mind!
Were you able to figure out the blinking problem? I am interested in what could have caused it as my program is not set up to do such a thing.
Irobots
wierdo1111
Posted: Sun Mar 24, 2013 5:18 pm Post subject: Re: ***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing
You can flush the keys after the mouse is clicked because they still get stored even before clicking, and maybe right click to cancel the drawing. I didn't look at your code that much, but you can just store everything in arrays instead of using the Delete_me file. Also make it so it doesn't crash when you enter a key wrong during drawing. Lastly at one of the beginning screens your should make it so you can change the resolution of the draw screen.
irobots
Posted: Sun Mar 24, 2013 5:40 pm Post subject: Re: ***Picture Helper for Turing (simple to use program to make different shapes and fill for your own program in Turing
Wierdo1111,
I do not understand what you are talking about at all with the keys flush, maybe you could actually look at the program and understand how it works before you say something as irrelevant as you did say.
However, I do agree with you in changing the screen resolution and figuring out a way to delete previous lines along with keeping the program from crashing in the case of an invalid input. I would appreciate if you could fix it.