Revision 41
| core/app/canvas/layer.py (revision 41) | ||
|---|---|---|
| 30 | 30 |
self.fbo = Fbo(size=(self.width, self.height), with_depthbuffer=False) |
| 31 | 31 |
self.color = kwargs.get('color')
|
| 32 | 32 |
set_brush('brushes/brush_particle.png',25)
|
| 33 |
#self.layer_clear() |
|
| 33 |
self.layer_clear() |
|
| 34 | 34 |
self.brush_color=(0,0,0,1) |
| 35 | 35 |
self.id = kwargs.get('id')
|
| 36 | 36 |
|
| 37 | 37 |
def layer_clear(self): |
| 38 |
self.fbo.bind() |
|
| 39 |
#glClearColor(1,1,1,1) |
|
| 40 |
#glClear(GL_COLOR_BUFFER_BIT) |
|
| 41 |
set_color(self.color) |
|
| 42 |
drawRectangle((0,0),(self.width,self.height)) |
|
| 43 |
self.fbo.release() |
|
| 38 |
with self.fbo: |
|
| 39 |
glClearColor(1,1,1,1) |
|
| 40 |
glClear(GL_COLOR_BUFFER_BIT) |
|
| 41 |
set_color(self.color) |
|
| 42 |
drawRectangle((0,0),(self.width,self.height)) |
|
| 44 | 43 |
|
| 45 | 44 |
def on_touch_down(self, touches, touchID, x, y): |
| 46 | 45 |
if self.collide_point(x,y): |
| ... | ... | |
| 49 | 48 |
if touches[touchID].is_double_tap: |
| 50 | 49 |
self.layer_manager.move_layer_down(self.id) |
| 51 | 50 |
elif touches[touchID].is_double_tap: |
| 52 |
self.layer_manager.move_layer_up(self.id) |
|
| 51 |
self.layer_manager.move_layer_up(self.id) |
|
| 53 | 52 |
if self.layer_manager.mode == "draw": |
| 54 | 53 |
with self.fbo: |
| 55 | 54 |
set_color(*self.brush_color) |
| ... | ... | |
| 69 | 68 |
with self.fbo: |
| 70 | 69 |
set_color(*self.brush_color) |
| 71 | 70 |
set_brush('brushes/brush_particle.png',25)
|
| 72 |
paintLine((ox,oy,cur_pos[0],cur_pos[1])) |
|
| 73 |
self.fbo.release() |
|
| 71 |
paintLine((ox,oy,cur_pos[0],cur_pos[1])) |
|
| 74 | 72 |
self.touches[touchID] = self.to_local(x,y) |
| 75 | 73 |
return True |
| 76 | 74 |
|
Also available in: Unified diff
