Author Topic: SpriteEditor  (Read 3945 times)

johnno56

  • Guest
Re: SpriteEditor
« Reply #30 on: November 19, 2014 »
John:

Yes, the image in the 'preview' area is 64x64. This is the image that I need to 'grab' and to save. I have also notice that the image id of the colourpatch sampler is set to 1 (one). I have modified my program accordingly. That explains why I had soooo many colourpatches in my folder  :-[

Whenever I save a file, by habit I include the extension, but will add the 'check' as you have suggested. As a note: I have also placed a check on the image dimensions to only allow 64x64. Eventually, I want to be able to load multiple images sizes (up to 64x64) and have the main grid automatically reconfigure... I hope... My brain hurts... Too much thinking... **sigh**

I have been working on this program quite some time (I am not as clever or as fast as most of you guys) and I need to take my mind of it for a little while. It's Thursday, in Melbourne of Oz, and I will resume my efforts on Monday. I am going to use the time to relax and upgrade my PC to the next version of Linux Mint.

Have a great weekend....

J

Marcus

  • Administrator
  • Hero Member
  • *****
  • Posts: 542
    • View Profile
Re: SpriteEditor
« Reply #31 on: November 22, 2014 »
... Is it Monday in Australia yet?
.\\\opz

johnno56

  • Guest
Re: SpriteEditor
« Reply #32 on: November 23, 2014 »
It's 5:17pm on Sunday. So, no, not quite.... I have had my caffeine fix and the brain does not hurt... yet. :)

J

Marcus

  • Administrator
  • Hero Member
  • *****
  • Posts: 542
    • View Profile
Re: SpriteEditor
« Reply #33 on: December 16, 2014 »
Hey, where's the rest of that editor? I've got some sprites to draw!

Just kidding! I assume you're busy with other stuff (like that Christmas thing everyone's talking about), but if you're stuck in code just say WOOT!
.\\\opz

johnno56

  • Guest
Re: SpriteEditor
« Reply #34 on: December 16, 2014 »
I found a serious flaw with my coding...  Me.

My intention was to create an editor and started with "all guns blazing" but failed to consider if I could actually finish it. I have intentions to add more features (ellipse, rectangle, line, fill, erase etc - and if brave enough, brushes) but all I can manage are the icons/buttons. I have absolutely no idea how to even code the features. It's taken me ages just to get editor to where it is now.

I find it most discouraging not being able to code as well as you guys. My apologies for disappointing you. I will continue my research and attempt upgrades as I am able.

J

kcfb

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: SpriteEditor
« Reply #35 on: December 17, 2014 »
Hi J ... you shouldn't be discouraged - this is a really ambitious project, and I for one, wouldn't know how to complete it. Why not keep it on the back burner while you try other things, then I think you will find that over time you will be able to complete more and more of the work on the project as ideas come to you when you are doing other things in NaaLaa?

johnno56

  • Guest
Re: SpriteEditor
« Reply #36 on: December 17, 2014 »
Many thanks for your advice.

Modified listing to include a 'Pencil' button. Cannot draw unless button is pressed. Selecting 'New' will reset button status. That one was rather easy. The program 'draw' function, by default, was set to active. Merely added a button to change the status.

One button down and ? to go...  I hope my coffee supply holds out....

(will release update once fully tested... ;) )

J

Rick3137

  • Sr. Member
  • ****
  • Posts: 342
  • May the Force be with You
    • View Profile
    • Rick's Programs
Re: SpriteEditor
« Reply #37 on: January 05, 2015 »
Hi J ... you shouldn't be discouraged - this is a really ambitious project, and I for one, wouldn't know how to complete it. Why not keep it on the back burner while you try other things, then I think you will find that over time you will be able to complete more and more of the work on the project as ideas come to you when you are doing other things in NaaLaa?

 I know how you all feel. I tend to have between 10 and 20 projects under construction at the same time, hoping that I will some day finish one. It is much easier for me to start a new one than finish an old one.

Marcus

  • Administrator
  • Hero Member
  • *****
  • Posts: 542
    • View Profile
Re: SpriteEditor
« Reply #38 on: January 05, 2015 »
Hi J ... you shouldn't be discouraged - this is a really ambitious project, and I for one, wouldn't know how to complete it. Why not keep it on the back burner while you try other things, then I think you will find that over time you will be able to complete more and more of the work on the project as ideas come to you when you are doing other things in NaaLaa?

 I know how you all feel. I tend to have between 10 and 20 projects under construction at the same time, hoping that I will some day finish one. It is much easier for me to start a new one than finish an old one.

Hear, hear!  ;)
.\\\opz

johnno56

  • Guest
Re: SpriteEditor
« Reply #39 on: January 06, 2015 »
Ok. Here is the latest update, for want of a better word, with only minor changes.

I have finally got the 'pencil' button to function normally. You cannot draw on the main grid unless the 'pencil' button is active. When 'new' is activated, the status of the 'pencil' button will revert to its normal state, as it does when other buttons (not yet active) are selected. ie: If 'line' is selected, the status of the 'pencil' button will change to normal and the same goes in reverse.

It isn't much, but at least it is something...  :-\

I am going to either beg or borrow code to work out the rest of the buttons. Maybe, just one step at a time.

(can anyone suggest a better name than 'Sprite Editor'? I think that one has been 'done to death'. Oh. One other thing. How do I change the caption/heading that appears at the top of the display area?)

J
« Last Edit: January 06, 2015 by johnno56 »

kcfb

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: SpriteEditor
« Reply #40 on: January 06, 2015 »
Good to see the progress Johnno.......it's looking good. I hope to find some time tonight to look more closely, if not the weekend, but work awaits me now..........Not sure how or if you can change the window title - I've always just accepted that the file name goes there, but maybe the experts will know......

johnno56

  • Guest
Re: SpriteEditor
« Reply #41 on: January 06, 2015 »
Thanks for replying. Hope work goes well for you.

J

kcfb

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: SpriteEditor
« Reply #42 on: January 07, 2015 »
Hi Johnno.....Just had a little while to look at your code and I think it looks really good, with so many possibilities.....I know that previous posts talked about saving the image files, and I think Ricks code works with a small change:

Code: [Select]
procedure storefile()
filename2$ = savefile("png")
if lower(right(filename2, len(filename2) - 4)) <> ".png" then filename2 = filename2 + ".png"

for prevx = 0 to 63
for prevy = 0 to 63
set image primary
set colori pixeli((prevx*10)+5,(prevy*10)+5)
set image 12
set pixel prevx,prevy
draw pixel prevx,prevy
next
next

set image 12

save image 12, filename2$
set image primary
rem ----------------------------------------------
rem Display "file saved"
rem ----------------------------------------------
endproc


There will be better ways of doing this I'm sure, and if so, hopefully someone will post it. Don't forget to create image 12 first by putting
Code: [Select]
create image 12, 64, 64
...somewhere - I'd suggest up where you set the primary window at the top of the listing maybe?

One request - will you consider moving the "New" button away from the main grid - I kept accidentally resetting my drawings when I got too enthusiastic with the colouring...... :)
Thanks - Kevin.
« Last Edit: January 07, 2015 by kcfb »

johnno56

  • Guest
Re: SpriteEditor
« Reply #43 on: January 07, 2015 »
Thanks very much, Kevin.

I've only just got out of bed and the brain has not had its caffeine fix yet. I will modify the code as per your request. Hmm. Good point about the 'New' button. I could either isolate it from the rest or add an "Are you sure?" and an offer to save. The easiest method is isolation. I will add the "other" stuff later.

Again, thanks for the suggestions, and the code.

J

johnno56

  • Guest
Re: SpriteEditor
« Reply #44 on: January 07, 2015 »
Kevin,

I have been trying to figure out how to put a 'pop up' error message box in the center of the display and removing it without destroying everything that was behind it. I'm not sure if I am making any sense... still no coffee... any ideas?

J