Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/andengine/forums/includes/utf/utf_tools.php on line 1804
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1804)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1804)
[phpBB Debug] PHP Notice: in file /includes/session.php on line 1007: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1804)

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/andengine/forums/includes/utf/utf_tools.php on line 1804

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/andengine/forums/includes/utf/utf_tools.php on line 1804

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/andengine/forums/includes/utf/utf_tools.php on line 1804

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/andengine/forums/includes/utf/utf_tools.php on line 1804

Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/andengine/forums/includes/utf/utf_tools.php on line 1804
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4363: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1804)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4365: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1804)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4366: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1804)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4367: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1804)
AndEngine - Forums • Vertex Helper : Features

Vertex Helper

  ... the case you feel the need for a new feature or want to submit one.

Vertex Helper

Postby ZAN » Tue Dec 14, 2010 2:08 pm

I've created a tool which helps to create polygon body definitions from sprite. The program generates java or xml code fragment according to specified pattern ("new Vector2(...)," by default, but you can modify it).

Example:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.  
  2. //your code
  3. public static Body createHexBody(final PhysicsWorld pPhysicsWorld, final Shape pShape, final BodyType pBodyType, final FixtureDef pFixtureDef){
  4. final float width = pShape.getWidthScaled() / PIXEL_TO_METER_RATIO_DEFAULT;
  5. final float height = pShape.getHeightScaled() / PIXEL_TO_METER_RATIO_DEFAULT;
  6. final Vector2[] vertices = {
  7.        
  8. //autogenerated code
  9.  new Vector2(-0.42188f*width, -0.23438f*height),
  10.  new Vector2(+0.00000f*width, -0.50000f*height),
  11.  new Vector2(+0.43750f*width, -0.21875f*height),
  12.  new Vector2(+0.40625f*width, +0.25000f*height),
  13.  new Vector2(+0.00000f*width, +0.50000f*height),
  14.  new Vector2(-0.43750f*width, +0.25000f*height)
  15.  
  16. //your code again
  17. };
  18. return PhysicsFactory.createPolygonBody(pPhysicsWorld, pShape, vertices, pBodyType, pFixtureDef)
  19.  
Parsed in 0.013 seconds, using GeSHi 1.0.8.4


Here it is a screenshot:
Screenshot.png
Screenshot
Screenshot.png (26.02 KiB) Viewed 8523 times


It requres python2.7 and PyQt, but will work both on Windows and Linux platorms.

Updated: Windows installer available (everything included), installed app can be started with "Start -> All Programs -> avhelper"
Download the lastest version from http://code.google.com/p/andengine-vert ... loads/list
Last edited by ZAN on Mon Jan 03, 2011 7:40 pm, edited 4 times in total.
ZAN
 
Posts: 8
Joined: Tue Dec 14, 2010 1:35 pm

Re: Vertex Helper

Postby Radzell » Sun Dec 26, 2010 12:55 pm

im not good with python so how do i run it.
Radzell
 
Posts: 467
Joined: Sun Jul 04, 2010 8:52 am

Re: Vertex Helper

Postby ZAN » Mon Dec 27, 2010 12:46 pm

Radzell wrote:im not good with python so how do i run it.

I've changed the code slightly, so for the lastest versions follow next instructions:
1. Install Python2.7 and PyQt
2. Unpack tarball
3. Just run avhelper.pyw

It will work on each platform, but for Linux more preffered way is:
1. Install Python2.7 and PyQt
2. Unpack tarball
3. Run a command "sudo python setup.py install"
4. Then you can run program with a command "avhelper.pyw"
ZAN
 
Posts: 8
Joined: Tue Dec 14, 2010 1:35 pm

Re: Vertex Helper

Postby Vignesh » Mon Jan 03, 2011 7:24 am

I have tried the steps given by you,

The "python setup.py install " command gives the following error "error: package directory 'vertex_helper' does not exist".

And also no window is visible when avhelper.pyw is opened.

System Specs:
Windows 7 32bit, Python 3.1, PyQt 4.8.2
Vignesh
 
Posts: 2
Joined: Mon Jan 03, 2011 7:16 am

Re: Vertex Helper

Postby ZAN » Mon Jan 03, 2011 12:36 pm

Vignesh wrote:I have tried the steps given by you,

The "python setup.py install " command gives the following error "error: package directory 'vertex_helper' does not exist".

And also no window is visible when avhelper.pyw is opened.

System Specs:
Windows 7 32bit, Python 3.1, PyQt 4.8.2

Try Python2.7 instead of Python3.1. Be sure that installed PyQt version is also for 2.7.
Porting for the lastest Python comming soon.
ZAN
 
Posts: 8
Joined: Tue Dec 14, 2010 1:35 pm

Re: Vertex Helper

Postby Vignesh » Mon Jan 03, 2011 2:41 pm

Great.. got it working with python 2.7.

A note to windows 7 users: make sure pythonw.exe runs with admin privileges, else the app will not be able to open the sprite file.
Vignesh
 
Posts: 2
Joined: Mon Jan 03, 2011 7:16 am

Re: Vertex Helper

Postby ZAN » Mon Jan 03, 2011 6:50 pm

MSI installer has been added to downloads list.
Installed app can be lauched with "Start -> All Programs -> avhelper"
No Python and PyQt required.
ZAN
 
Posts: 8
Joined: Tue Dec 14, 2010 1:35 pm

Re: Vertex Helper

Postby stanchat » Sat Feb 26, 2011 5:19 am

I was playing with this tonite and this is a really useful tool. Thanks for providing to the community.
stanchat
 
Posts: 24
Joined: Tue Sep 07, 2010 7:59 pm

Re: Vertex Helper

Postby ZAN » Wed Jun 22, 2011 7:18 pm

Try new improvements provided by turiandras - lines between vertexes, multiplie fixtures and even loading vertexes from text (for default pattern).
Скриншот andengine-vertex-helper.jpg
Скриншот andengine-vertex-helper.jpg (39.61 KiB) Viewed 8116 times
ZAN
 
Posts: 8
Joined: Tue Dec 14, 2010 1:35 pm

Re: Vertex Helper

Postby KyleHatch » Sat Jul 09, 2011 3:53 pm

Hi. having some problems with the program, try un-installing and reinstalling.

i can add points on my object, but i get no output vertices....

Image

ideas? am i being a bit rubbish?

EDIT: Fixed it, i should of just compared pictures, i didnt have the pattern vector in.

new Vector2(%+.5ff*width, %+.5ff*height),

:)
KyleHatch
 
Posts: 29
Joined: Mon Apr 11, 2011 4:46 pm

Next

Return to Features

Who is online

Users browsing this forum: No registered users and 5 guests