Author Topic: sprite editor  (Read 1071 times)

Re: sprite editor
« Reply #45 on: July 05, 2018, 01:11:46 PM »
Thanks Fellippe, that should do nicely.

Do you know of any InForm apps that did use 3 sliders for RGB, seems to me it would be THE Demo for slider bars.
B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00

Offline FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: sprite editor
« Reply #46 on: July 05, 2018, 02:17:54 PM »
Well, InForm Designer has three sliders for RGB color mixing, and it's been created using InForm Designer itself, so there's your app.

Re: sprite editor
« Reply #47 on: July 05, 2018, 02:29:44 PM »
That's where I saw it before!  :)

 Thanks Fellippe
B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00

Offline Petr

  • I am instructed.
Re: sprite editor
« Reply #48 on: July 05, 2018, 04:13:03 PM »
Thank you very much, Johnno56. What version of Linux do you use? I repaired one of the deferred older notebooks, so I would install it there to test it. First I will have to find instructions on installing QB64 under Linux ....

Offline Petr

  • I am instructed.
Re: sprite editor
« Reply #49 on: July 05, 2018, 04:45:27 PM »
Quote
Modify

Hmm... I wonder about reversing that process, click a point from the blown up image and set color selector to that color (along with the slider bars).

It is not difficult. This is a normal percent example: You have a R bar, a G bar and a B bar. 0% is on the left and it is 0. 100% is on right, the value for R and G i B is maximum 255. So if it loads with the POINT or _MEMGET command a pixel of the image, the function returns three R, G, B values. For example the color _RGB32 (128,255,0), so 128 is exactly 50 percent of 256, the driver for R is set in the middle. 255 for G is 100 percent, that set driver to the right. B is 0, ie zero percent. The driver for B will be at the beginning. On the same principle working drivers in my SNDRAW player.

Offline johnno56

  • Live long and prosper.
Re: sprite editor
« Reply #50 on: July 05, 2018, 06:39:52 PM »
Petr,

In regards to installing Linux, now days, it's not hard at all. You mentioned an "older" notebook... Some of the mainstream versions of Linux, as with newer versions of Windows, will probably be a bit sluggish on older machines mainly because the newer OS's can be quite taxing on older systems.

Linux has installations for older machines... Yay! Ubuntu has Lubuntu and Xubuntu for example... All you do is go to their homepage; Download the ISO image; Burn it to a DVD or USB drive; Pop it into the notebook and boot. You can either install or test it without installing... Just in case... lol

QB64.net has both 32 and 64 bit versions for Linux. (Oh no! QB64.NET has problems! No. the main website is fine. It seems that the Forums are "on the fritz"...)

If you need help... You know where I am... lol

J
Logic is the beginning of wisdom.

Offline Petr

  • I am instructed.
Re: sprite editor
« Reply #51 on: July 06, 2018, 04:45:19 PM »
Outside the topic: BPlus, Here's your realization, setings graphics drivers according to the returned color. Fullscreen is NOT USED :-D

Code: [Select]
SCREEN _NEWIMAGE(800, 600, 32)
DO
    i& = _LOADIMAGE("bart.jpg", 32)
    _PUTIMAGE , i&
    WHILE _MOUSEINPUT: WEND
    c& = POINT(_MOUSEX, _MOUSEY)
    Red = _RED32(c&): green = _GREEN32(c&): blue = _BLUE32(c&)
    clr$ = STR$(Red) + ", " + STR$(green) + ", " + STR$(blue)
    LOCATE 4, 1: PRINT "Selected color is"; clr$
    LINE (550, 10)-(750, 70), _RGB32(0, 0, 0), BF

    _PRINTSTRING (570, 12), "R"
    R = Drive(600, 20, 255, Red)
    _PRINTSTRING (570, 32), "G"
    g = Drive(600, 40, 255, green)
    _PRINTSTRING (570, 52), "B"
    b = Drive(600, 60, 255, blue)

    LOCATE 1, 1: PRINT "R driver is set to"; R; " percent"
    LOCATE 2, 1: PRINT "G driver is set to"; g; " percent"
    LOCATE 3, 1: PRINT "B driver is set to"; b; " percent"
    _DISPLAY
LOOP UNTIL _KEYHIT = 27
END

FUNCTION Drive (xpos, ypos, max, vlue)
    LINE (xpos, ypos)-(xpos + 100, ypos)
    Drive = (vlue / max) * 100
    l2 = xpos + Drive
    LINE (l2, ypos + 5)-(l2 + 5, ypos - 5), , BF
END FUNCTION

Offline Petr

  • I am instructed.
Re: sprite editor
« Reply #52 on: July 06, 2018, 04:54:29 PM »
please, give LOADIMAGE before DO. This Odin politic - time limited edit for own sources is really bad.

Offline johnno56

  • Live long and prosper.
Re: sprite editor
« Reply #53 on: July 06, 2018, 08:41:21 PM »
Guys,

I have decided to shelve the Sprite Editor. I originally started it to, "See if I could", but came up against what "I" call a problem, of simply loading and saving each project. I ended up with the same problem using sdlbasic (original version) as I am now having with QB64. Projects can eventually be saved and loaded but not 'simply'. I feel the amount of work needed to complete the project kind of out weighs the concept of a "simple" editor. You guys have put in more work than I could have hoped for and for that I'm very appreciative. I think from now on I will restrict my ideas to what I can actually achieve...

Thanks guys.

J
Logic is the beginning of wisdom.

Offline FellippeHeitor

  • QB64 Developer
  • LET IT = BE
    • QB64.org
Re: sprite editor
« Reply #54 on: July 06, 2018, 11:03:03 PM »
Steve also has a file select library that's cross platform, maybe he could repost it.

Offline SMcNeill

  • QB64 Developer
Re: sprite editor
« Reply #55 on: July 07, 2018, 03:02:13 AM »
Steve also has a file select library that's cross platform, maybe he could repost it.

http://qb64.freeforums.net/thread/63/file-directory-listing-arrays

Try the above. It's not a GUI file selection tool, but it's a crossplatform way to get information into a set of directory and file arrays.  I've got a GUI version around here somewhere as well, but most folks just seem to enjoy making their own interface and using the stripped down version here to get the information they need, instead.  ;)

Offline Petr

  • I am instructed.
Re: sprite editor
« Reply #56 on: July 07, 2018, 05:29:06 AM »
Johnno56, do not be sad. Every such project just wants to do it in small steps until you finally get a big result. I will continue with this and add commented source codes here. This time I will test them in both Linux and Windows before i post it here.

Re: sprite editor
« Reply #57 on: July 08, 2018, 01:29:29 PM »
Johnno, this is excellent project idea!
B = B + ...
QB64 x 64 v1.2 2018 0228/86 git b30af92
QB64 v1.2 20180228/86 git 6fde149
QB64 v1.2 [dev build]_d84bb00