-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Thxios <[email protected]>
- Loading branch information
Showing
20 changed files
with
193 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
from PIL import Image | ||
|
||
img = Image.open('newDa/hue4.png') | ||
img = Image.open('newDa/button_only.png') | ||
img = img.convert('RGBA') | ||
pixel = img.load() | ||
w, h = img.size | ||
for x in range(w): | ||
for y in range(h): | ||
if pixel[x, y] != (0, 0, 0, 0): | ||
pixel[x, y] = (0, 0, 0, 255) | ||
if pixel[x, y] == (0, 255, 0, 255): | ||
pixel[x, y] = (0, 0, 0, 0) | ||
|
||
img.save('newDa/value_wheel.png') | ||
img.save('newDa/button_only.png') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
from src.lib import * | ||
from src.Section._Section import Section | ||
from src.Brush import Brush | ||
|
||
|
||
class BrushSection(Section): | ||
bgColor = (43, 43, 43) | ||
|
||
buttonImage = pg.image.load('data/BrushButton.png') | ||
buttonSelectedImage = pg.image.load('data/BrushButton_selected.png') | ||
buttonIconImage = pg.image.load('data/ButtonIcon.png') | ||
buttonSize = buttonImage.get_width() | ||
buttonTerm = 3 | ||
buttonRect: List[pg.Rect] = [] | ||
|
||
brushCount = 7 | ||
|
||
currentBrush = Brush.GetCurrentBrushIndex() | ||
|
||
def Setup(self, x, y, w, h): | ||
super().Setup(x, y, w, h) | ||
for _brush in range(self.brushCount): | ||
self.buttonRect.append( | ||
pg.Rect(6, 6 + (self.buttonSize + self.buttonTerm) * _brush, self.buttonSize, self.buttonSize) | ||
) | ||
|
||
def Update(self): | ||
self.surface.fill(self.bgColor) | ||
for _brush in range(self.brushCount): | ||
if _brush == self.currentBrush: | ||
self.surface.blit(self.buttonSelectedImage, (6, 6 + (self.buttonSize + self.buttonTerm) * _brush)) | ||
else: | ||
self.surface.blit(self.buttonImage, (6, 6 + (self.buttonSize + self.buttonTerm) * _brush)) | ||
self.surface.blit(self.buttonIconImage, (0, 0)) | ||
|
||
def OnMouseDown(self, button, x, y): | ||
x, y = self.LocalPosition((x, y)) | ||
for _brush, _button in enumerate(self.buttonRect): | ||
if _button.collidepoint(x, y): | ||
self.currentBrush = _brush | ||
Brush.SetBrush(_brush) | ||
self.Changed() | ||
break |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.