Page 1 of 1

Canvas Calculator ........[ No data files !!! ]

PostPosted: Sun Oct 04, 2009 4:47 pm
by BloodRaven
Hi friends i created a small calculator [ you can only add 2 numbers ...now ...]
I created that calculator using one canvas and 2 text actors ......You can't find any file inside the data folder !!!


Everything else including the frame are created using lines by the canvas ! [ there is only lines now , i will extent the frame ]
I think this demo will be a good file to draw lines in what shape we want ....
That code is tooooo long , please be patient ... hehehehehehe

Info :

Press 0 to 9 keys to get your number into the text file....
Press + to add one number ...
Press = to get your answer ...
Press Back space to clear the text box.


The numbers are limited to 9999999.For the very first time when you reached that limit it show an error [ i mean mistake ]...sorry ....

Try it......
More file on this will come soon .......

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Sun Oct 04, 2009 11:08 pm
by superman123
cool :)

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Mon Oct 05, 2009 1:56 am
by BloodRaven
Thanks ..... :mrgreen:
[ Yes cool now , but it was real hot to make and read it ; hehehehe ...becoz that code in that canvas is really bigggggggggg] :D

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Mon Oct 05, 2009 3:14 pm
by Superbeni
good work!
but if i press "6" he writes "7" , but this is not really important, i think

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Mon Oct 05, 2009 6:43 pm
by BloodRaven
:lol: :lol: :lol: :lol: :lol:
Sorry brother that may be a mistake , Or check your Keyboard ...hehehehe ...
Thanks .....
hey there is source code change it in " key down 6 "

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Tue Oct 06, 2009 1:16 am
by DST
This script can replace all your buttons in the draw of the canvas. It's about 30 lines compared to the 250 or so the buttons use currently. It can draw as many buttons as you want, all day long, and the same loop can be used to find which button the mouse just clicked on.

Code: Select all
int i;
int j;
int k;
int xmin;
int ymin;
int xmax;
int ymax;
int sizex;
int sizey;
/*Declare starting variables. This example will create a 3x4 grid of buttons, as a normal keypad has.
You can use this same loop to find which button was clicked on, too.

Draw all the buttons at once*/   

setpen(0, 200, 248, 0, 10);  //set button color and sizes
sizex=70;                    //horizontal and vertical buttonsize
sizey=50;

for (i=0; i<9; i++){     //9 is the total number of buttons to make
//everything in this loop will happen 9 times.

xmin=80+(j*100);         // offset + distance to start of next button
ymin=200+(k*70);         //Look at the end of the loop to find where we set j and k

xmax=xmin+sizex;         //find other corner of button using buttonsize.
ymax=ymin+sizey;

    moveto(xmin, ymin);  //Draw the rectangle
    lineto(xmax, ymin);
    lineto(xmax, ymax);
    lineto(xmin, ymax);
    lineto(xmin, ymin);
   
    j++;                 //cue the next button to the right

    if(j==3){            //0,1,2 makes 3. This is your horizontal number of buttons.
    j=0;                 //The vertical number is i (from the loop)/horizontal number. (9/3=3).
    k++;                 //cue the first button of the next row
        }                //end vertical row check
 
                  }      //end loop.

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Tue Oct 06, 2009 9:08 am
by BloodRaven
Thanks for the code ... . :D
I am just started here .... That's the reason for that big code...Thanks for your support.
I am looking to draw lines as the way i want.This is the first step for that.
Now i finished test on animating the canvas or lines [ i hope it will work , but the finishing work is a total disorder :cry: .]
I created an animation which is a box which will open and close [ 50 % is complete with success ] and i am using only lines and one canvas.....and when i finished that i will post the demo

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Tue Oct 06, 2009 2:10 pm
by DST
The other day, my boss and i were trying to make a bid on a job, and the boss asked me what 15 x 50 =.

I couldn't answer. I couldn't do the math.

Because for the last 4 years, i've just made my computer do it. I used to do multiplication in my head, and i was exceptionally good at it, but why do that anymore?

That's precisely what a computer is for!

So if you plan out the numbers, calculating and inputting them yourself, then you're not really 'using' your computer. You're still using your fleshy brain, but just having the answer spoken by the computer.


The computer is here to work for you! Put it to work! :D

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Wed Oct 07, 2009 8:34 am
by BloodRaven
Hehehehehehe :lol: :lol: :lol:
Yes i will use my computer but one big doubt ...
Then
Is Computer can generate games and programs itself ???
It is just from humans and use your brains to use computers to create excellent PROJECTS ...hehehehe

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Wed Oct 07, 2009 8:22 pm
by superman123
I am sending a message on my iPod :D

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Thu Oct 08, 2009 9:19 am
by BloodRaven
superman123 wrote:I am sending a message on my iPod :D


:lol: :lol: good luck

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Thu Oct 08, 2009 11:03 pm
by DST
BloodRaven wrote:Is Computer can generate games and programs itself ???
It is just from humans and use your brains to use computers to create excellent PROJECTS ...hehehehe


Yes, a computer can generate games and programs itself.

Ten years ago, they were struggling to make a computer drive a car without crashing.
Now, the computer cars can beat human driver lap times by considerable amounts, with fewer crashes, better mileage, and they even can detect and avoid more bumps and cracks in the road than a human can.

We are crossing over the threshold from where computers were toys or scientific inventions, to the point where they are actually useful and better at certain tasks than we are.

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Fri Oct 09, 2009 4:38 am
by BloodRaven
Ok , but i am using them to play games and create game [ just started ] and some serious programming.Becoz i want to use them as the way i want.

I am using brain !! :D becoz i have one :lol: :lol: :lol: :lol:

Re: Canvas Calculator ........[ No data files !!! ]

PostPosted: Fri Oct 09, 2009 10:50 am
by Lexcondran
hello bloodraven ?
lol yes there are few people that actually matter in the land of G-e
thats cause out of the 12000+ people only like 30 talk or most are gone for a long long time yes
oh yeah im hungry