Author Topic: SpriteEditor  (Read 4398 times)

johnno56

  • Guest
Re: SpriteEditor
« Reply #105 on: June 25, 2015 »
Our power was down only for 35 mins!! Impressed...

I had difficulty in either choosing a set of icons to download and use or create my own. There were too many to choose from so I used old trust Gimp and the threat of a power outage as motivation....  I will try to do better for the next release.

You most certainly did see an erase. But if memory serves correctly, erase was used for creating a black cell. I had also popped in a "Clear" function (in the new version) that basically does the same as your 'erase all'.

In regards to the highlight problem: Yeah, that one is a bit of a mind-snap. I don't know what I was thinking. I'm going to have to redo that one. Until the next update, my recommendation, would be to pretend it isn't there... lol

Now that our power is back, I can complete the 'erase' icon and begin to integrate your modifications. I will probably get rid of those large rectangle buttons and replace them with the 40x40 icons. I will also modify the display to the size that you have (1200x700). Should not be a problem once most of those rectangles are gone...

Well, this program won't finish by itself...

Note: I figure that we keep our icons to reasonable number. Otherwise the program will only bloat. Any other function suggestions? eg: "Spray"? "Cut and Paste"?  Just some thoughts. I will check out some possible code for other features. Do you think a deadline should be set before it is unleashed to the Forum? Deadlines make for great motivation... ;)

I have to change that click sound...

J

J

johnno56

  • Guest
Re: SpriteEditor
« Reply #106 on: June 25, 2015 »
Here's the erase icon....

J


B+

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: SpriteEditor
« Reply #107 on: June 25, 2015 »
For additional tools along with spray, you could also checker and stripe though that would require two color choices, these would be easiest to code in a square area but I suppose could be done in circle, checkers could be altered by 1x1,2x2,3x3... stripes also could have alternate thickness that plus 4 directions horizontal/vertical/kiddy corners left and right...
Have I blown your mind yet?

No? Along with checkers you could do dots, maybe a whole screen for background or a grid! Imagine a grid drawn on a grid! And of course these can have alternate sizes or gaps too...
Have I blown your mind yet?

No? How about letters as you had gotten from Gimp? and of course there are all sorts of fonts and sizes and Bold/Italic/Underline...
Have I blown your mind yet?

Don't worry my guess is that 80-99% of all drawing especially editing will just need a couple clicks with the pen/pencil tool! You had the editor essentially done before I came across the code!

On issue of deadlines, my motivation with this project was to learn more about graphics and using Naalaa and learning for me is never ending so... (the deadline is literal!). If I really needed to draw stuff I'd just get Gimp or figure out MS Paint.

I have a question on using "set colori":
How come I can't draw with a "set colori" with pixili taken directly from file loading? Why does it have to be saved in maingrid array first? Does not make sense, unless one can only "set pixel" with a "set colori" (as Peter does when saves and restores a screen section for his message box code) is this the case?

loading from file:
Code: [Select]
rem ------------------------------------------------------------
rem TRANSFER TO MAIN GRID ?
rem ------------------------------------------------------------
for imagex = 0 to 63
for imagey = 0 to 63
rem ??? set colori maingrid[imagex][imagey]
rem -------------------------------------------
rem "Poor Man's" Fill
rem -------------------------------------------
r5 = getR(maingrid[imagex][imagey])
g5 = getG(maingrid[imagex][imagey])
b5 = getB(maingrid[imagex][imagey])
set color r5,g5,b5
dotx = imagex * 10
doty = imagey * 10
draw rect dotx,doty,9,9,true
next
next

Well this one dingy caused me to recode all my drawing algorithms that were drawing to an array had to be changed to drawing directly to screen. There is something about not being able to draw directly from a file pixel color setting... ???
« Last Edit: June 25, 2015 by B+ »
B+

johnno56

  • Guest
Re: SpriteEditor
« Reply #108 on: June 25, 2015 »
Even before you mention chequered or stripped, I had been considering a 'pattern fill'. I came across that one when I had my old Amstrad back in the mid-late 80's. Not even sure I still have the code. Even if I did, I'm not sure if I could convert it to fill on a celled grid...

Text was another consideration. As for me, I think it would be quicker to just draw the text, than try and figure out how to place it on a cell grid... I'm not all that familiar with Naalaa yet... *sigh*

Ok. Maybe deadlines was not such a good idea... next.

Hmm "set colori". I cannot claim credit for that section of code. At the time I was struggling with 'How to simulate a flood fill.' Because the cells are square, the obvious solution, was to use the filled 'rect'  command. Unfortunately, it was not that obvious to me, at the time. I think Peter was kind enough to help me out with that problem. All I know of that particular piece of code is that: When an image is loaded form file, it is placed in the preview window, then colour scanned and translated to the grid. "colori" had to be used and then that colour converted to an "rgb" value to set the colour for the grid rectangle. I hope I got that right and it made some form of sense...

If memory serves me correctly, the "set color" command requires an "rgb" format. If you assign say, "r = rgb(255,0,0)", then you can use "set colori r".

J

B+

  • Full Member
  • ***
  • Posts: 215
    • View Profile
Re: SpriteEditor
« Reply #109 on: June 26, 2015 »
Pattern fill, hmmm... that would cover a host of needs! Excellent idea!!!
Another name for it might be tile, you draw one tile and then multiply through the whole square or click areas you desire to tile... that could work!

J, you did use text from Gimp for the tool icon letters didn't you? If not, those are very impressive hand drawn letters!

Yeah, from what you say about color, I think the maingrid array is not necessary. I will experiment. Best to get questions worked out in small bits of code where you can focus on the issue without distractions.

I also want to see if I can improve on drawing algorithms.

B+