On Tue, Nov 12, 2013 at 12:39 PM, Mikolaj <[email protected]> wrote:
> I was going to ask how to hack a resizeable color layer, but I think I
> managed to patch it together just by guessing. I needed this for creating a
> visible box for in game selection.
>
> class ResizeableCL(ColorLayer):
>
> # resize is called from on_mouse_drag
> def resize(self, dx, dy):
> self.width += dx
> self.height += dy
>
> def draw(self):
> x, y = self.width, self.height
> ox, oy = 0, 0
> self._vertex_list.delete()
> self._vertex_list = self._batch.add(4, pyglet.gl.GL_QUADS, None,
>
I would do:
+ The initial vertex list created and stored in on_onter, like in
ColorLayer
+ The same draw as in ColorLayer
+ resize *updates* the vertex list
self._vertex_list.vertices = ...
--
You received this message because you are subscribed to the Google Groups
"cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/groups/opt_out.