Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: (Help) User draw/paint pixels by pixels?  (Read 8164 times)

0 Members and 1 Guest are viewing this topic.

Jackieryder

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • Email
Re: (Help) User draw/paint pixels by pixels?
« Reply #15 on: April 03, 2015, 04:14:06 pm »
Would that erase at specific spot and not the whole thing? Like the eraser from Paint or Photoshop/GIMP?

What kind of primitive wuld I switch it to?

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: (Help) User draw/paint pixels by pixels?
« Reply #16 on: April 05, 2015, 03:08:14 pm »
Would that erase at specific spot and not the whole thing? Like the eraser from Paint or Photoshop/GIMP?

It would erase where you draw it. Think of it as layers, once you draw the eraser on top everything below it will no longer exist. You can take my basic example and change it to draw everything to a render texture and then not store the primitives. Once you draw the eraser everything below it is gone.

Quote
What kind of primitive wuld I switch it to?

You would probably want 2 triangles (total of 6 vertices). Start drawing the eraser square at the begin point and end the other corner at the current mouse position. Really though, you need to play with it and try it. Having us do it all for you takes the fun out of it.  ;)
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

Jackieryder

  • Newbie
  • *
  • Posts: 15
    • View Profile
    • Email
Re: (Help) User draw/paint pixels by pixels?
« Reply #17 on: April 10, 2015, 06:10:30 am »
Sorry, I think I need a little bit more clarification. By erase/draw on top of the layer, do you mean the eraser is basically the background color drawing on top of the image, or it actually remove the vertex at that point?

I get what you are trying to do with the 2 triangle thing (or atleast I think I do). What you are trying to do is creating a rectangle (or square) that will draw things in the shape of a square that take more than one pixel. I think I can do that. However I'm still not sure about what i just asked above, as far as I understand, by doing what you said I'm just drawing the color white in the shape of a square over them, which in turn of course erase the bottom layer. But that isn't what I'm looking for however. When I erase something, I want the pixel at that location to be gone, as oppose to being recolored.