Hello,
I'm tring to reproduce (copy-paste mouse_elastic_box_selection.py) the
MinMaxRect and ProbeQuad. ProbeQuad is working, but MinMaxRect is not
visible. When i debug/look at logs, python correctly enter in
begin_drag, adjust_elastic_box, etc functions. But rectangle selection
is not visible.
I hope it will be not to much difficult to enter in my code, but to
reproduce:
Setup commands:
git clone https://github.com/buxx/synergine2.git test_bux_cocos
cd test_bux_cocos/
git checkout tile
virtualenv --no-site-packages -p /usr/bin/python3.5 venv3.5
source venv3.5/bin/activate
pip install -r requirements.txt
Run the script:
python sandbox/tiledstrategy/run.py maps/003
You should see a top view map, with some trees and some actors moving.
ProbeQuad is visible under mouse. When click, drag and move, terminal
who run command print the following log:
begin drag
begin drag selection: drag_selecting, drag_moving True False
But no rectangle appear.
Interesting source code is layer construction here
<https://github.com/buxx/synergine2/blob/tile/synergine2_cocos2d/layer.py#L32>
and layers classes (copy-paste mouse_elastic_box_selection.py copied
code is here) here
<https://github.com/buxx/synergine2/blob/tile/synergine2_cocos2d/gui.py>.
Regards,
Bux.
Le 27/06/2017 à 22:27, claudio canepa a écrit :
On Tue, Jun 27, 2017 at 4:42 PM, Bastien Sevajol
<[email protected] <mailto:[email protected]>> wrote:
Hi,
My intent is the number two: add actors who will move on a grid
specified in the tmx file.
That will not work with RectMapLayer; it can work with
tiles.TmxObjectLayer plus mapcoliders.TMXObjectMapCollider
There are some demos for them at
https://github.com/los-cocos/etc_code/tree/master/tmx_collision
I thought RectMapLayer can help me about that with this "grid"
management and functions like get_at_pixel/get_in_region (to
select actor with click for example).
If the actors quantity is big, the selection can be too slow; then it
would be better to use collision module (theres an example of mouse
picking with collision module in samples\
mouse_elastic_box_selection.py , available from the cocos repo ar the
zip downloaded from pipy)
--
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 https://groups.google.com/group/cocos-discuss.
For more options, visit https://groups.google.com/d/optout.