Author Topic: sprite editor  (Read 51737 times)

0 Members and 1 Guest are viewing this topic.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: sprite editor
« Reply #60 on: September 07, 2020, 06:19:31 pm »
As per your request....

I have cobbled together an 'eyedrop' function that will select a colour from the main grid... There maybe bugs... (no surprises there... lol)  Give it a test and if it's ok then we'll keep it....

The attached file is only the main program.
* sprdraw03.zip (Filesize: 3.39 KB, Downloads: 193)
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: sprite editor
« Reply #61 on: September 07, 2020, 07:57:36 pm »
Oh man! you were already loading the sample image. I've got to catch up with all your procedures.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: sprite editor
« Reply #62 on: September 07, 2020, 08:54:44 pm »
Ok as minimally invasive as I could I added stuff so you can save image. You are now loading "untitled.png" when you Load and Save to same when you save. You will have to figure out how to handle getting file name strings. But perhaps I could help with that too by getting list of files in the directory, my next addition.

SaveImage will not save if it finds a file with save name already existing, it also has a number of other numbered error messages. I just moved on whether the file actually got saved or not. But you can find out if file actually did get saved or what kind of error.  It's in the giant BM file.

I also decreased screen width a shade and centered to my screen to just fit out from under my tool bar.

I also put a _LIMIT in the main loop to save me from CPU fan noise!

So here is v03b with save image:
* sprdraw03b.zip (Filesize: 1.4 MB, Downloads: 185)
« Last Edit: September 07, 2020, 08:56:32 pm by bplus »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: sprite editor
« Reply #63 on: September 08, 2020, 12:47:57 am »
Check your messages.... Here is your result...
Screenshot at 2020-09-08 14-41-16.png
* Screenshot at 2020-09-08 14-41-16.png (Filesize: 4.16 KB, Dimensions: 465x153, Views: 234)
Logic is the beginning of wisdom.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: sprite editor
« Reply #64 on: September 08, 2020, 01:10:16 am »
The size of the screen is fine. If you need it to be smaller (in width) then the "spare box" to the far right can be removed. It was only put there to gauge the width of three sets of buttons.

Saving and loading worked as you had coded. Cool.

I had made some changes to version 3 while you were working on 3b... The mods were mainly around the messagebox routine and a few messages. No drama. I will add the changes to 3b... Somebody has to move to someone's timezone... lol Hmm... That could be difficult. I cannot go more that 5kms from home (a few exceptions) and the Victorian borders have been closed. So you cannot move here.

Can you imagine if we both made significant changes? Oh the duplication of effort... There has to be a better way to manage projects remotely.... Any ideas?
« Last Edit: September 08, 2020, 01:17:14 am by johnno56 »
Logic is the beginning of wisdom.

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: sprite editor
« Reply #65 on: September 08, 2020, 02:21:38 am »
Ok. I have merged v3 and v3b into v4.

I think the message box system, although works, could do with an overhaul... lol
"Line" has been hard coded with a message.
"Save" message works.
Note: I think a scan of the main grid prior to saving may be in order. Even though the main grid is "blank" the save function will store an empty sprite...
Not sure if the "lucon" font is needed...
I have removed the far right button... just in case...

Anyway. Give it a test and see what you think?
* sprdraw04.zip (Filesize: 4.6 KB, Downloads: 203)
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: sprite editor
« Reply #66 on: September 08, 2020, 10:52:56 am »
The size of the screen is fine. If you need it to be smaller (in width) then the "spare box" to the far right can be removed. It was only put there to gauge the width of three sets of buttons.

Good but I am optimistically hoping we will eventually need that many buttons! But if they stay the same size, they could be shifted a tiny bit to get and keep overall screen width to where I had it set. 1300 is just over my screen limit with my toolbar along the left side of screen.


Quote
Saving and loading worked as you had coded. Cool.

This is very good news that I'm so glad to have confirmed. Yeah Steve McNeill!

Quote
I had made some changes to version 3 while you were working on 3b... The mods were mainly around the messagebox routine and a few messages. No drama. I will add the changes to 3b... Somebody has to move to someone's timezone... lol Hmm... That could be difficult. I cannot go more that 5kms from home (a few exceptions) and the Victorian borders have been closed. So you cannot move here.

Perhaps this would be a good time, to mention I have a pop up Dialog type Message Box you can move around the screen and then closes and gone with message read. I also have a pop up Input Box you also can move around the screen. Altogether they would be maybe another 300 lines of code?

Quote
Can you imagine if we both made significant changes? Oh the duplication of effort... There has to be a better way to manage projects remotely.... Any ideas?

Yeah I had already duplicated an effort of yours by loading the sample at startup and making a preview2grid subroutine. You already had all that in the Load button!

But we have done alright in the past working together on projects: Battleship, Blackjack... and that's just the B's ;-))

Well you are in charge of the Official Code versions in this project I will just offer mods to be assimilated into it or not adding a b at end of version number to distinguish code sets.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: sprite editor
« Reply #67 on: September 08, 2020, 11:05:43 am »
Ok. I have merged v3 and v3b into v4.

I think the message box system, although works, could do with an overhaul... lol
"Line" has been hard coded with a message.
"Save" message works.
Note: I think a scan of the main grid prior to saving may be in order. Even though the main grid is "blank" the save function will store an empty sprite...
Not sure if the "lucon" font is needed...
I have removed the far right button... just in case...

Anyway. Give it a test and see what you think?

Yeah, how married to your message box system are you? I am sorry I had forgotten I had worked out a Message Box dialog that you can move around the screen and then close. Same with an Input Box. So you might want to see those before going further with built in one on your main screen.

And the Tiny Navigator app might be just the thing for retrieving filenames but it also has a rather large set of lines of code and would be done on a whole separate screen.

It's like I've been building tools (except for save image) with this program in mind. eg I have a color picker too that employs slide bars but I think I like the point and click style better that Dav is working on for this kind of app and that Ken used with one of his Paint Programs.

Well while you sleep, the night shift elves will be working on adding tools to version #4.  ;-))
« Last Edit: September 08, 2020, 11:12:20 am by bplus »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: sprite editor
« Reply #68 on: September 08, 2020, 12:31:30 pm »
I'm open to any type of msgbox... I only put a 'fixed' box in the corner because it was the easiest... not necessarily then best...

It's about 2:30am and I'd better get some sleep. Sat through the original 1960 'Time Machine' AND the 2002 version back to back... Can't get enough of H.G....

BIG day tomorrow... hopefully... Our coffee delivery should arrive.... Moo Ha Ha...
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: sprite editor
« Reply #69 on: September 08, 2020, 05:27:32 pm »
Hi @johnno56

Just started going over version 4 and 2 notes:
1) Include all files needed to run the bas code in the package so people wont have to be looking all over for stuff.
also if you want to use a special font include it in the zip package.

PPS if you are worried about cluttering up forum with attachments, we can delete old abandoned ones as the new ones come to replace them as with Blackjack.

2) Don't forget to update the title / header label of program, v04 here. With all sorts of copies about this is needed to sort out which it is we are looking at. I am trying to keep an untouched copy of your newest program and one that I am modifying plus backup files of older versions.

PS your message box looks good and works :)
« Last Edit: September 08, 2020, 05:37:17 pm by bplus »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: sprite editor
« Reply #70 on: September 08, 2020, 07:09:03 pm »
My first posting was over 2mb (didn't think about all the 'clutter' I tend to gather... lol) Now it's down to about 5k without the assets. The special font was just for me... Being a mono-spaced font helped with text placement within the message box. Most of the users here are Windows-based and Lucon.ttf, if I am not mistaken, is either already part of the OS's fonts or is supplied with the Windows version of QB64. But, you are correct, I should include the font file.

Clutter on a forum? Interesting turn of phrase... Isn't what we are all submitting a 'type' of 'clutter'? lol
No. I'm not concerned about forum clutter. That responsibility usually falls to either the site Admin or the forum host. But we should be mindful of how much we contribute... To that end... We have all been given the ability to create and edit our own posts so perhaps we could be given the ability to only delete our own posts... Just thinking outside the box... We should make it a habit, ok "I" should make it a habit, to properly manage my backups and leave 'site clutter' management to those who do it so well...

Title headers.... I almost always forget about those... Good point.

Message box. It's a drastically modified "Perter" version. It's not Peter's but it will do until something better comes along. Thanks anyway. That might be an interesting project... A message box library... This is the part where someone says, "But we already have a library for that." and totally destroy one of my few ideas...  Story of my life.... *sigh*

Coffee time!
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: sprite editor
« Reply #71 on: September 09, 2020, 12:18:04 am »
Well the elves had to work overtime because they hit a few snags. But we have everything working, at least in Windows.

I have to warn when you Load a file you have to press f to get the real filenames list up. The one showing on the right is just a 20 file sample of the whole list that is loaded into an array that you can scroll, mouse click, arrow key, page home end... even type in item number and enter, all these options to select a file off the listing. And if you change your mind use top right X or escape.

Oh yeah, I included a copy of direntry.h and Readme.txt file that reminds you to make sure you have a copy of this in your QB64 folder. This is so, hopefully, the file name retriever can work both in Windows and Linux.

Some screen shots from SprDraw04b and the zip is last attachment:

Press f when you are in the folder you want to select a file.PNG
* Press f when you are in the folder you want to select a file.PNG (Filesize: 17.46 KB, Dimensions: 1284x700, Views: 225)
Naming my master piece.PNG
* Naming my master piece.PNG (Filesize: 47.65 KB, Dimensions: 1190x668, Views: 238)
Master piece Saved.PNG
* Master piece Saved.PNG (Filesize: 46.24 KB, Dimensions: 1224x668, Views: 226)
* sprdraw04b.zip (Filesize: 400.56 KB, Downloads: 173)
« Last Edit: September 09, 2020, 12:37:55 am by bplus »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: sprite editor
« Reply #72 on: September 09, 2020, 12:29:57 am »
Stone the flammin' crows! Ya blood's worth bottling!
Logic is the beginning of wisdom.

Offline bplus

  • Global Moderator
  • Forum Resident
  • Posts: 8053
  • b = b + ...
    • View Profile
Re: sprite editor
« Reply #73 on: September 09, 2020, 12:33:46 am »
Can you load files?

Oh you are going to keep me hanging in suspense :)
« Last Edit: September 09, 2020, 12:47:18 am by bplus »

Offline johnno56

  • Forum Resident
  • Posts: 1270
  • Live long and prosper.
    • View Profile
Re: sprite editor
« Reply #74 on: September 09, 2020, 01:21:09 am »
Yes. I can load files.... Cool...
Logic is the beginning of wisdom.