GLBasic forum

Main forum => Announcements => Topic started by: Takeuchi on 2013-Feb-27

Title: PixTo - Das Pixeltool
Post by: Takeuchi on 2013-Feb-27
Sorry for german, i`m not very familiar with english. :/
At the End of this post, i will try it in english. (=

(http://imageshack.us/a/img6/7623/pixtologo.png)

Über das Programm:

Das wäre das das Erste was ich mit GLBasic Programmiert habe. Eigentlich wollte ich mich an ein Spiel ranmachen. Da ich allerdings sämtliche Bildverarbeitungsprogramme mit ihrem Funktionen etwas unübersichtlich finde, habe ich mich entschlossen
ein eigenes zu programmieren.


Funktionen:

   - 208 verschiedene Farben zur Auswahl
   - Speichert erstellte Sprites als .bmp in der Größe 32x32
   - Es besteht die Möglichkeit eine .bmp Datei in der Größe 96x128 zu erstellen
    (Das war hauptsächlich dafür gedacht um mit LOADANI und DRAWANI einen bewegten
    Sprite erzeugen zu können)
   - Radiergummi Werkzeug
   - Pipetten Werkzeug
   
Beispielbilder:

http://imageshack.us/a/img197/5131/screenshot3mu.png
http://imageshack.us/a/img541/8750/screenshot2gx.png
http://imageshack.us/a/img13/9471/screenshotlbs.png
http://imageshack.us/a/img20/6889/farbauswahl.png
http://imageshack.us/a/img708/6829/benutzeroberflche.jpg


Für alle Funktionen habe ich ein Benutzerhandbuch erstellt und dem Archiv beigelegt.

Falls jemand das Benutzerhanduch zu übersetzen, wäre ich sehr dankbar dafür.

Now in english. (=

This is my first program, wich i`m develop with GLBasic.
It`s named PixTo - The Pixeltool.

Features:

   - 208 different Color to choose
   - Save Sprites as .bmp (32x32 Pixels)
   - Possibel to save a .bmp file (96x128 Pixels)
    (This is for LOADANI and DRAWANI to create a moving Sprite)
   - Rubber tool
   - Eyedrop?? tool

Please take a look at "Beispielbilder" above.

For more information read the "Benutzerhandbuch" i`ve added in the PixTo.zip file.
Saddly the "Benutzerhandbuch" is in german too. Maybe there is someone, who translate it.

///////////////////////////
//       UPDATE         //
//////////////////////////

Here`s a new Version of PixTo.

New:

- Added a real "Menu bar" at the top
- Now its possible to load Sprites 32x32 (just .bmp)
- Screenshot function
- Rotating the sprite by 90°
- Save the 32x32 Sprite and the animation to .jpg or .bmp or .png
- Flip the sprite vertical or horizontal
- The Zoomwindow and the grid can be turned off
- Now the program is in englisch (i hope there a no mistakes with my translation  :) )

At the current state, the Help option dose exactly nothing

Sample Pictures:

http://imageshack.us/a/img593/7941/95374423.jpg (http://imageshack.us/a/img593/7941/95374423.jpg)
http://imageshack.us/a/img6/9756/26044779.jpg (http://imageshack.us/a/img6/9756/26044779.jpg)
http://imageshack.us/a/img593/4862/18574026.jpg (http://imageshack.us/a/img593/4862/18574026.jpg)
http://imageshack.us/a/img692/8053/25570565r.jpg (http://imageshack.us/a/img692/8053/25570565r.jpg)

Title: Re: PixTo - Das Pixeltool
Post by: Ian Price on 2013-Feb-27
That looks really neat. Seems like a great start to your GLB development. :)

Do you have plans to add new features?
Title: Re: PixTo - Das Pixeltool
Post by: erico on 2013-Feb-27
Interface looks really great, quite clean.
Some features would be nice, like a 1 level undo, anim preview, sprite get/put to move things around and a 1 level light table/onion skin thing.

Keep it up!
Title: Re: PixTo - Das Pixeltool
Post by: mentalthink on 2013-Feb-27
For starting it's very nice...
Das ist kulcklich gute programmieren    (my mother some words In Deutsch are awesoming complex to write  :D, at least for a Spanish..)
Title: Re: PixTo - Das Pixeltool
Post by: Takeuchi on 2013-Feb-28
Thanks a lot to all off you. (=

Quote from: Ian Price on 2013-Feb-27
That looks really neat. Seems like a great start to your GLB development. :)

Do you have plans to add new features?
Yes, there are a couple of features i like to add.
These are: - Possibility to rotat the edit field
                    - Loading a 32x32 .bmp to work on
                    - a helpfile to look at all functions directly in the programm
                    - and of course, with my translation book a english version. (=

Quote from: erico on 2013-Feb-27
Interface looks really great, quite clean.
Some features would be nice, like a 1 level undo, anim preview, sprite get/put to move things around and a 1 level light table/onion skin thing.

Keep it up!
A undo function would be realy  nice, at the moment i dont have any idea how to manage this.
I`ll think about it in the future!


Quote from: mentalthink on 2013-Feb-27
For starting it's very nice...
Das ist kulcklich gute programmieren    (my mother some words In Deutsch are awesoming complex to write  :D, at least for a Spanish..)

It is? I can't say anything about this, because german is my motherlanguage. :D
Title: Re: PixTo - Das Pixeltool
Post by: Takeuchi on 2013-Mar-08
I`ve just added a new version to my first Post. (=

Actualy i`ve no idea of DIM...i cant get the Point how its work.
So, the Code is reeaaaly big with all those variable stuff  :S

Code (glbasic) Select
Wordcount:23512 commands
compiling:

linking:
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 99.1 sek. Zeit: 02:41
Erstellen: 1 erfolgreich.
Title: Re: PixTo - Das Pixeltool
Post by: erico on 2013-Mar-08
ops, can´t understand the german debug, better wait for someone else on that.

But don´t worry, I took me literally ages to understand DIM and how to use it.
Not that I can perfectly handle it nowadays, but I can use it in a simple way. :good:

About the UNDO, if it is just a 1 level undo. Would be cool, so we can quickly see something with or without the last change. :)

I kind of don´t know how an UNDO would work, but it has been discussed, I guess, a few times before.
One is here:
http://www.glbasic.com/forum/index.php?topic=7744.msg64296#msg64296

Cheers, lovely application going so far! You keep it up and I may have to learn german...verstanden?  :P
Title: Re: PixTo - Das Pixeltool
Post by: Ian Price on 2013-Mar-08
DIM just DIMensions an array (basically tells the computer how big the box is to store all those nice variables you'll need in your app). If you try to overfill the box, the content won't fit (the computer throws a fit).

I like to think of arrays as little boxes - each one holds just one item of a specific form - either words or numbers.

So if you want an array to hold 10 boxes use -

eg. DIM box[10] - means you'll have 10 boxes to store values

box[0]
box[1]
...
...
box[9]

You must remember that arrays always start at zero and end one less than the amount you specified with DIM.

Each of those boxes can be assigned a value -

Code (glbasic) Select

GLOBAL box%[]
DIM box[10]

box[0]=100
box[1]=57
box[2]=36
box[3]=58


or if you want the variables to be text -

Code (glbasic) Select

GLOBAL word$[]
DIM word$[10]

word$[0]="Hello"
word$[1]="To be or not to be"
word$[2]="I'm going to win the lottery this week"


etc.

If you want to use a specific box just grab the data -

eg
Code (glbasic) Select
PRINT box[3],10,10

or

Code (glbasic) Select

FOR n=0 TO 9
PRINT box[n],100,n*10
PRINT word$[n],200,n*10
NEXT


Arrays can make it easy to store lots of variables/text in a tidy way that can be easily accessed from anywhere in your program.

You can even make arrays multi-dimensional (eg for use in map editors)

Code (glbasic) Select

GLOBAL map%[]
DIM map[100][100]

FOR Y=0 TO 99
FOR X=0 TO 99
map[x][y]=57
NEXT
NEXT
Title: Re: PixTo - Das Pixeltool
Post by: Takeuchi on 2013-Mar-12
Quote from: erico on 2013-Mar-08
ops, can´t understand the german debug, better wait for someone else on that.

Dosent matter, i just want to say that the wordcount is to big.
Maybe later i look forward to sort an short the code a little bit.

It is realy confusing with 20 subs and functions.
Just the Penciltool took me 2 hours of writting....

Code (glbasic) Select
// ------------------------------------------------------------- //
// ---  PENCIL  ---
// ------------------------------------------------------------- //
FUNCTION PENCIL: numwor$
// Diese Variablen sind als LOCAL definiert:
// numwor$

       // tempruen1,tempgruen2 ..... are the 10x10 editable pixels in the edit section
       // tool = 3 is the pencil tool
       // curcol is just the current color

    IF mx>70 AND mx<80 AND my>60 AND my<70 AND mbl = (1)  AND tool = 3 THEN tempgruen1 = curcol
    IF mx>90 AND mx<100 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen2 = curcol
    IF mx>110 AND mx<120 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen3 = curcol
    IF mx>130 AND mx<140 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen4 = curcol
    IF mx>150 AND mx<160 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen5 = curcol
    IF mx>170 AND mx<180 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen6 = curcol
    IF mx>190 AND mx<200 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen7 = curcol
    IF mx>210 AND mx<220 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen8 = curcol
    IF mx>230 AND mx<240 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen9 = curcol
    IF mx>250 AND mx<260 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen10 = curcol
    IF mx>270 AND mx<280 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen11 = curcol
    IF mx>290 AND mx<300 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen12 = curcol
    IF mx>310 AND mx<320 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen13 = curcol
    IF mx>330 AND mx<340 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen14 = curcol
    IF mx>350 AND mx<360 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen15 = curcol
    IF mx>370 AND mx<380 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen16 = curcol

    IF mx>60 AND mx<70 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen1r = curcol
    IF mx>80 AND mx<90 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen2r = curcol
    IF mx>100 AND mx<110 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen3r = curcol
    IF mx>120 AND mx<130 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen4r = curcol
    IF mx>140 AND mx<150 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen5r = curcol
    IF mx>160 AND mx<170 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen6r = curcol
    IF mx>180 AND mx<190 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen7r = curcol
    IF mx>200 AND mx<210 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen8r = curcol
    IF mx>220 AND mx<230 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen9r = curcol
    IF mx>240 AND mx<250 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen10r =curcol
    IF mx>260 AND mx<270 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen11r =curcol
    IF mx>280 AND mx<290 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen12r =curcol
    IF mx>300 AND mx<310 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen13r =curcol
    IF mx>320 AND mx<330 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen14r =curcol
    IF mx>340 AND mx<350 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen15r =curcol
    IF mx>360 AND mx<370 AND my>60 AND my<70 AND mbl = (1) AND tool = 3 THEN tempgruen16r =curcol

        IF mx>60 AND mx<70 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen17 = curcol
    IF mx>80 AND mx<90 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen18 = curcol
    IF mx>100 AND mx<110 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen19 = curcol
    IF mx>120 AND mx<130 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen20 = curcol
    IF mx>140 AND mx<150 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen21 = curcol
    IF mx>160 AND mx<170 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen22 = curcol
    IF mx>180 AND mx<190 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen23 = curcol
    IF mx>200 AND mx<210 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen24 = curcol
    IF mx>220 AND mx<230 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen25 = curcol
    IF mx>240 AND mx<250 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen26 = curcol
    IF mx>260 AND mx<270 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen27 = curcol
    IF mx>280 AND mx<290 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen28 = curcol
    IF mx>300 AND mx<310 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen29 = curcol
    IF mx>320 AND mx<330 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen30 = curcol
    IF mx>340 AND mx<350 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen31 = curcol
    IF mx>360 AND mx<370 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen32 = curcol

    IF mx>70 AND mx<80 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen17r = curcol
    IF mx>90 AND mx<100 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen18r = curcol
    IF mx>110 AND mx<120 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen19r =curcol
    IF mx>130 AND mx<140 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen20r =curcol
    IF mx>150 AND mx<160 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen21r =curcol
    IF mx>170 AND mx<180 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen22r =curcol
    IF mx>190 AND mx<200 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen23r =curcol
    IF mx>210 AND mx<220 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen24r =curcol
    IF mx>230 AND mx<240 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen25r =curcol
    IF mx>250 AND mx<260 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen26r =curcol
    IF mx>270 AND mx<280 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen27r =curcol
    IF mx>290 AND mx<300 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen28r =curcol
    IF mx>310 AND mx<320 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen29r =curcol
    IF mx>330 AND mx<340 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen30r =curcol
    IF mx>350 AND mx<360 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen31r =curcol
    IF mx>370 AND mx<380 AND my>70 AND my<80 AND mbl = (1) AND tool = 3 THEN tempgruen32r =curcol

    IF mx>70 AND mx<80 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen33 = curcol
    IF mx>90 AND mx<100 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen34 = curcol
    IF mx>110 AND mx<120 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen35 = curcol
    IF mx>130 AND mx<140 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen36 = curcol
    IF mx>150 AND mx<160 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen37 = curcol
    IF mx>170 AND mx<180 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen38 = curcol
    IF mx>190 AND mx<200 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen39 = curcol
    IF mx>210 AND mx<220 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen40 = curcol
    IF mx>230 AND mx<240 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen41 = curcol
    IF mx>250 AND mx<260 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen42 = curcol
    IF mx>270 AND mx<280 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen43 = curcol
    IF mx>290 AND mx<300 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen44 = curcol
    IF mx>310 AND mx<320 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen45 = curcol
    IF mx>330 AND mx<340 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen46 = curcol
    IF mx>350 AND mx<360 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen47 = curcol
    IF mx>370 AND mx<380 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen48 = curcol

    IF mx>60 AND mx<70 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen33r = curcol
    IF mx>80 AND mx<90 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen34r = curcol
    IF mx>100 AND mx<110 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen35r =curcol
    IF mx>120 AND mx<130 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen36r =curcol
    IF mx>140 AND mx<150 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen37r =curcol
    IF mx>160 AND mx<170 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen38r =curcol
    IF mx>180 AND mx<190 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen39r =curcol
    IF mx>200 AND mx<210 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen40r =curcol
    IF mx>220 AND mx<230 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen41r =curcol
    IF mx>240 AND mx<250 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen42r =curcol
    IF mx>260 AND mx<270 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen43r =curcol
    IF mx>280 AND mx<290 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen44r =curcol
    IF mx>300 AND mx<310 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen45r =curcol
    IF mx>320 AND mx<330 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen46r =curcol
    IF mx>340 AND mx<350 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen47r =curcol
    IF mx>360 AND mx<370 AND my>80 AND my<90 AND mbl = (1) AND tool = 3 THEN tempgruen48r =curcol

        IF mx>60 AND mx<70 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen49 = curcol
    IF mx>80 AND mx<90 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen50 = curcol
    IF mx>100 AND mx<110 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen51=curcol
    IF mx>120 AND mx<130 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen52=curcol
    IF mx>140 AND mx<150 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen53=curcol
    IF mx>160 AND mx<170 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen54=curcol
    IF mx>180 AND mx<190 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen55=curcol
    IF mx>200 AND mx<210 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen56=curcol
    IF mx>220 AND mx<230 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen57=curcol
    IF mx>240 AND mx<250 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen58=curcol
    IF mx>260 AND mx<270 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen59=curcol
    IF mx>280 AND mx<290 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen60=curcol
    IF mx>300 AND mx<310 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen61=curcol
    IF mx>320 AND mx<330 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen62=curcol
    IF mx>340 AND mx<350 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen63=curcol
    IF mx>360 AND mx<370 AND my>90 AND my<100 AND mbl = (1) AND tool = 3 THEN tempgruen64=curcol

        // and so on...... until

   IF mx>370 AND mx<380 AND my>370 AND my<380 AND mbl = (1) AND tool = 3 THEN tempgruen512r=curcol

ENDFUNCTION // PENCIL


Quote from: erico on 2013-Mar-08
But don´t worry, I took me literally ages to understand DIM and how to use it.
Not that I can perfectly handle it nowadays, but I can use it in a simple way. :good:
Sounds god! I dont have the time to spend 45 ages to understand how DIM work. :D

Quote from: erico on 2013-Mar-08
About the UNDO, if it is just a 1 level undo. Would be cool, so we can quickly see something with or without the last change. :)



I kind of don´t know how an UNDO would work, but it has been discussed, I guess, a few times before.
One is here:
http://www.glbasic.com/forum/index.php?topic=7744.msg64296#msg64296

I`ve tried to do a GRABSPRITE before anthing is changed in the sprite. Then i`ve just loaded the GRABSPRITE
and draw it back to the screen.
I dont know why, but it dosent work. :/

So at the current state there is a simliar option. If the middle mousebutton is pressed, then PixTo remeber the sprite. If you go to "EDIT" and then to "TEMP DATA" it will load the spirte where you pressed the middle mousebutton.
I think it is just the same like i`ve tried before. I dont know why the second one work but the first one does not. :/

Quote from: erico on 2013-Mar-08
Cheers, lovely application going so far! You keep it up and I may have to learn german...verstanden?  :P

Yes, i`ve.....verstanden :P



Quote from: Ian Price on 2013-Mar-08
DIM just DIMensions an array (basically tells the computer how big the box is to store all those nice variables you'll need in your app). If you try to overfill the box, the content won't fit (the computer throws a fit).

I like to think of arrays as little boxes - each one holds just one item of a specific form - either words or numbers.

That means the edit section in my program need something like:

Code (glbasic) Select
GLOBAL editwindow
GLOBAL white = RGB(255,255,255)
LOCAL y, x
DIM editwindow[31] [31]  // 32x10 pixels on the y-axe and 32x10 pixels on the x-axe

FOR y = 0 TO 31 and x = 0 TO 31

       editwindow[x][y] = white
         NEXT
.....
.....



Thats it?


Wow its realy hard to write so many in english :S
I cant belive i`ve got a mark 2 (best is 1), in schooltime, from my teacher 6 years back. :D
_______________________


Oh, and my girlfrind tried the program, she find a little bug an draw a unicorn. (=
(The bug was - the mouse,pencil eg was always under the word "TOOL")

Here is the unicorn and something i was drawing.
http://imageshack.us/a/img841/730/ponynr.jpg (http://imageshack.us/a/img841/730/ponynr.jpg)
http://imageshack.us/a/img27/8868/manlc.jpg (http://imageshack.us/a/img27/8868/manlc.jpg)

Before i forget it, there is a new tool. I call it colorswap.
I think the name says everything how it works. (=
Title: Re: PixTo - Das Pixeltool
Post by: matchy on 2013-Mar-13
Quote from: Takeuchi on 2013-Mar-12
It is realy confusing with 20 subs and functions.
Just the Penciltool took me 2 hours of writting....

I dont have the time to spend 45 ages to understand how DIM work. :D

As a programmer, you are developing bad habits, so why expect the right help?
Title: Re: PixTo - Das Pixeltool
Post by: Takeuchi on 2013-Mar-13
Quote from: matchy on 2013-Mar-13
Quote from: Takeuchi on 2013-Mar-12
It is realy confusing with 20 subs and functions.
Just the Penciltool took me 2 hours of writting....

I dont have the time to spend 45 ages to understand how DIM work. :D

As a programmer, you are developing bad habits, so why expect the right help?

Sorry i dont know waht you exactly mean. :/ Wich bad habbits do you mean?
Title: Re: PixTo - Das Pixeltool
Post by: erico on 2013-Mar-13
Maybe it is probably related to not using DIM and lot´s of IFs.

I once wrote a king of fighters (+- like Yie ar kung fu) kind of 2 players beat em up.
Since I didn´t know how to DIM, I had made the first player part of the code, and then duplicated the code and the variables.
It became huge and really hard to read. Same for another 4 players game. :-[

When I got GLBasic it was the first thing I tried to improve and am happy I can do it nowadays, makes a lot of things incredibly easier.
Still, I sometimes fallback to the old way if I´m in a hurry or can´t work around. Also, I still have some problems with functions and types, and I´m sure my code would be smaller and easier as well as better organized if I could push those...but I´m taking my time to learn them. :good:

I think maybe Matchy is refering to that.
Ian´s help on the DIM issue is quite helpfull.

Anyways, your app is coming along quite nice! Keep it up :good:
Title: Re: PixTo - Das Pixeltool
Post by: matchy on 2013-Mar-13
erico knows. The pencil function could be used with for loops and take the time to learn about arrays!

As a developer, you are doing fine, but as a programmer....not so much otherwise it will be hard in the future in any language, assuming you are starting out.