<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 29 November 2013 04:22, Eamonn Rea <span dir="ltr"><<a href="mailto:eamonnrea@gmail.com" target="_blank">eamonnrea@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Hello! I'm using Jython to write a game with Python/Jython/LibGDX. I wasn't having any trouble, and everything was going well, but sadly I can't access items in enumerations.<br>
<br>
If you know about the LibGDX library and have used it, you'll probably know about the BodyType enumeration for Box2D. I was trying to access the BodyType item in the enumeration. This didn't work, as Jython couldn't find the BodyType enumeration. I asked on the LibGDX forum and no one could help. So I'm hoping that someone here could help :-)<br>
<br>
So, is this a problem with LibGDX or Jython? I'm using the latest version of Jython.<br></blockquote><div><br></div><div>There is no problems accessing the elements of enumerations with Jython. The following was tested using Jython 2.7b1:</div>
<div><br></div><div><div><div>Jython 2.7b1 (default:ac42d59644e9, Feb 9 2013, 15:24:52)</div><div>[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_40</div><div>Type "help", "copyright", "credits" or "license" for more information.</div>
<div>>>> import java.util.Collections as Collections</div><div>>>> import java.util.Arrays as Arrays</div><div>>>></div><div>>>> a = Arrays.asList(1, 2, 3)</div><div>>>> print(a)</div>
<div>[1, 2, 3]</div><div>>>> e = Collections.enumeration(a)</div><div>>>> print(e)</div><div>java.util.Collections$2@f48007e</div><div>>>></div><div>>>> for i in e:</div><div>... print(i)</div>
<div>...</div><div>1</div><div>2</div><div>3</div></div></div><div><br></div><div>Therefore the problem is either with LibGDX or (more likely) way you are using it. Please post a minimal example that demonstrates the problem plus the exact error message you get (I don't know LibGLX at all, but someone else might, plus trimming it down to a minimal example may reveal the problem to you).</div>
<div><br></div><div>Tim Delaney</div></div></div></div>