Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
pixel art - Gideros Forum

pixel art

MoKaLuxMoKaLux Member
edited November 9 in General questions
Could I ask for your insights please?
I am trying to make a kind of pixel art drawing app (see it on twitch https://mokalux.itch.io/onetiletotileset)

I am using Pixels and I change its color with Pixel:setColor().
This is not very useable for drawings larger than 32 * 32 pixels on android.

Do you know any other way I can do this? It seems that Shape would be faster but I cannot change its color with the mouse. I tried with Shape:lineTo() but this is not drawing pixel art style.
Thank you in advance for your help.

Likes: oleg

Tagged:
+1 -1 (+1 / -0 ) Share on Facebook

Comments

  • nevermind I have found a probable way. I am trying it now.
    http://forum.giderosmobile.com/post/quote/7704/Comment_59759

    Thank you anyway! Peace.
  • hgy29hgy29 Maintainer
    Why not using a rendertarget without filtering ?
  • MoKaLuxMoKaLux Member
    edited November 9
    MoKaLux said:

    I am using Pixels and I change its color with Pixel:setColor().
    This is not very useable for drawings larger than 32 * 32 pixels on android.

    That doesn't work. Too many Pixels? (64*64 = 4096)
    MoKaLux said:

    nevermind I have found a probable way. I am trying it now.
    http://forum.giderosmobile.com/post/quote/7704/Comment_59759

    That doesn't work. Too many EventListeners? (64*64 = 4096)

    @hgy29 thank you. I need to change the color of the pixel using the mouse (finger).
    I am using rendertarget to render the final bitmap (can be 8*8, 16*16, 32*32... pixels).

    So do you mean that I draw using regular shape:lineto and render it to rendertarget without filtering?
  • MoKaLuxMoKaLux Member
    edited November 9
    edit the closest I have so far is using Shape:lineTo()
    	self.draw = Shape.new()
    	self.draw:setLineStyle(1, self.mycolor)
    	self:drawLine(coorx, coory)
    But this is not drawing in pixel art style :'(
    I think I need to use some kind of grid but right now I am limited to 32*32 only with this method :'(
  • hgy29hgy29 Maintainer
    Accepted Answer
    I am not sure what your problem is to be honest. I assumed it was a performance problem, having to draw each pixel of your image independently so that it could be edited.
    For this I would use a rendertarget of your final image size, map it onto a Bitmap and scale it up so that the user can see and interact with each pixel. Since it is a rendertarget, each pixel can then be updated by drawing a single 1x1 Pixel sprite onto the rendertarget.
    If you want to have a border around each cell, just draw a Path2D over it with as many horizontal and vertical lines you need.

    Likes: MoKaLux

    +1 -1 (+1 / -0 ) Share on Facebook
  • MoKaLuxMoKaLux Member
    edited November 9
    hgy29 is that me or?
    You are correct this is a performance issue dealing with mouse move.

    I don't understand when you say:
    each pixel can then be updated by drawing a single 1x1 Pixel sprite onto the rendertarget
    How do I draw that 1 pixel? that is the question.
    But don't worry I am still experimenting. With gideros we always find a way :)
  • hgy29hgy29 Maintainer
    Accepted Answer
    rt:draw(Pixel.new(color,1),offsetx,offsety) ?

    Likes: MoKaLux

    +1 -1 (+1 / -0 ) Share on Facebook
  • keszeghkeszegh Member
    Accepted Answer
    just have one pixel and in each moment position it under the cursor, change the color to what you need and draw it to the rendertarget (the line @hgy29 just wrote), and that's it.

    Likes: MoKaLux

    +1 -1 (+1 / -0 ) Share on Facebook
  • keszeghkeszegh Member
    Accepted Answer
    brush=Pixel.new(color,1)


    brush:setColor(color)
    rt:draw(brush,offsetx,offsety)

    Likes: MoKaLux

    +1 -1 (+1 / -0 ) Share on Facebook
  • MoKaLuxMoKaLux Member
    edited November 9
    hgy29, keszegh, you are wonderful, I tried everything but didn't think of this way. Thanks a million I will give it a try. Peace.
    @keszegh I was secretly hoping you would see my question :) don't forget that you are our gideros 2D man o:)
  • THANK YOU VERY MUCH FOR YOUR HELP THAT WORKED!

    VIVA GIDEROS FORUM! VIVA GIDEROS!

    Likes: antix

    +1 -1 (+1 / -0 ) Share on Facebook
Sign In or Register to comment.