Error with HTML.

197 views
Skip to first unread message

Epilol

unread,
Oct 17, 2013, 2:19:47 PM10/17/13
to pl...@googlegroups.com
Hello guys. I'm currently trying to run my game with html with the command : mvn -Phtml integration-test
and I'm receiving this error:

[INFO]    [ERROR] Errors in 'saga/progetto/tesi/core/TheKnowledgeTowers.java'
[INFO]       [ERROR] Line 53: No source code is available for type saga.progetto.tesi.navigable.Navigable; did you forget to inherit a required module?
[INFO]       [ERROR] Line 59: No source code is available for type saga.progetto.tesi.entity.dynamicentity.Player; did you forget to inherit a required module?
[INFO]       [ERROR] Line 80: No source code is available for type com.google.gson.Gson; did you forget to inherit a required module?
[INFO]       [ERROR] Line 111: No source code is available for type saga.progetto.tesi.navigable.button.Button; did you forget to inherit a required module?
[INFO]       [ERROR] Line 115: No source code is available for type saga.progetto.tesi.navigable.menu.HomeMenu; did you forget to inherit a required module?
[INFO]       [ERROR] Line 116: No source code is available for type saga.progetto.tesi.navigable.GameLoop; did you forget to inherit a required module?
[INFO]       [ERROR] Line 117: No source code is available for type saga.progetto.tesi.navigable.menu.CreationMenu; did you forget to inherit a required module?
[INFO]       [ERROR] Line 118: No source code is available for type saga.progetto.tesi.navigable.LoadingScreen; did you forget to inherit a required module?
[INFO]       [ERROR] Line 153: No source code is available for type saga.progetto.tesi.navigable.menu.GameMenu; did you forget to inherit a required module?
[INFO]       [ERROR] Line 154: No source code is available for type saga.progetto.tesi.map.cell.TowerFloor; did you forget to inherit a required module?
[INFO]       [ERROR] Line 155: No source code is available for type saga.progetto.tesi.map.cell.TowerWall; did you forget to inherit a required module?
[INFO]       [ERROR] Line 156: No source code is available for type saga.progetto.tesi.map.cell.TowerDecoration; did you forget to inherit a required module?
[INFO]       [ERROR] Line 157: No source code is available for type saga.progetto.tesi.entity.dynamicentity.enemy.Enemy; did you forget to inherit a required module?
[INFO]       [ERROR] Line 158: No source code is available for type saga.progetto.tesi.gui.Bar; did you forget to inherit a required module?
[INFO]       [ERROR] Line 159: No source code is available for type saga.progetto.tesi.entity.dynamicentity.equip.Equip; did you forget to inherit a required module?
[INFO]       [ERROR] Line 160: No source code is available for type saga.progetto.tesi.entity.dynamicentity.equip.Shield; did you forget to inherit a required module?
[INFO]       [ERROR] Line 161: No source code is available for type saga.progetto.tesi.entity.dynamicentity.spell.Spell; did you forget to inherit a required module?
[INFO]       [ERROR] Line 162: No source code is available for type saga.progetto.tesi.entity.staticentity.StorableDrop; did you forget to inherit a required module?
[INFO]       [ERROR] Line 163: No source code is available for type saga.progetto.tesi.entity.staticentity.Item; did you forget to inherit a required module?

the weird thing is that all those classes (except gson) are made by myself. What could it be and how can I fix it?

this is my .gwt.xml file:

<module rename-to='theknowledgetowers'>

  <inherits name='playn.PlayN'/>

  <inherits name='TheKnowledgeTowersAssets'/>

  <inherits name='tripleplay.TriplePlay'/>

  

  

  <source path='core'/>

  <source path='html'/>


  <public path="resources" />


  <entry-point class='saga.progetto.tesi.html.TheKnowledgeTowersHtml'/>

</module>



thanks a lot

Daniel Gerson

unread,
Oct 17, 2013, 2:57:07 PM10/17/13
to pl...@googlegroups.com

the weird thing is that all those classes (except gson) are made by myself. What could it be and how can I fix it?


Brigt Vik

unread,
Oct 17, 2013, 4:22:03 PM10/17/13
to pl...@googlegroups.com
Perhaps you are missing a reference to your source code in the pom.xml of your HTML module?

    <dependencies>
        <dependency>
            <groupId>saga.progetto.tesi</groupId>
            <artifactId>theknowledgetowers-core</artifactId>
            <version>${project.version}</version>
        </dependency>

        <dependency>
            <groupId>saga.progetto.tesi</groupId>
            <artifactId>theknowledgetowers-core</artifactId>
            <version>${project.version}</version>
            <classifier>sources</classifier>    <==HERE
        </dependency>

        ...
    </dependencies>

Message has been deleted

Epilol

unread,
Oct 17, 2013, 4:46:50 PM10/17/13
to pl...@googlegroups.com
so there is no way to use gson with gwt? Is there an equivalent way?

Brigt I still have the problem, I have source in my html pom

Epilol

unread,
Oct 17, 2013, 5:27:01 PM10/17/13
to pl...@googlegroups.com
my html pom

<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0"

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>

    <groupId>saga.progetto.tesi</groupId>

    <artifactId>theknowledgetowers</artifactId>

    <version>1.0-SNAPSHOT</version>

  </parent>


  <artifactId>theknowledgetowers-html</artifactId>

  <packaging>war</packaging>

  <name>TheKnowledgeTowers HTML</name>


  <properties>

    <gwt.module>saga.progetto.tesi.TheKnowledgeTowers</gwt.module>

    <gwt.name>theknowledgetowers</gwt.name>

    <!-- Desired Google App Engine SDK version -->

    <gae.version>1.6.1</gae.version>

  </properties>


  <dependencies>


  <dependency>

    <groupId>com.threerings</groupId>

    <artifactId>tripleplay</artifactId>

    <version>${playn.version}</version>

    <classifier>sources</classifier>

  </dependency>


    <dependency>

      <groupId>saga.progetto.tesi</groupId>

      <artifactId>theknowledgetowers-core</artifactId>

      <version>${project.version}</version>

      <classifier>sources</classifier>

    </dependency>


    <dependency>

      <groupId>saga.progetto.tesi</groupId>

      <artifactId>theknowledgetowers-assets</artifactId>

      <version>${project.version}</version>

    </dependency>


    <dependency>

      <groupId>com.googlecode.playn</groupId>

      <artifactId>playn-html</artifactId>

      <version>${playn.version}</version>

    </dependency>


    <dependency>

      <groupId>com.googlecode.playn</groupId>

      <artifactId>playn-html</artifactId>

      <version>${playn.version}</version>

      <classifier>sources</classifier>

    </dependency>


    <!-- Start Google App Engine dependencies -->

    <!-- These can be removed if you don't wish to deploy to Google App Engine -->

    <dependency>

      <groupId>com.google.appengine</groupId>

      <artifactId>appengine-api-1.0-sdk</artifactId>

      <version>${gae.version}</version>

    </dependency>


    <dependency>

      <groupId>com.google.appengine</groupId>

      <artifactId>appengine-api-labs</artifactId>

      <version>${gae.version}</version>

    </dependency>


    <dependency>

      <groupId>com.google.appengine</groupId>

      <artifactId>appengine-testing</artifactId>

      <version>${gae.version}</version>

      <scope>test</scope>

    </dependency>


    <dependency>

      <groupId>com.google.appengine</groupId>

      <artifactId>appengine-api-stubs</artifactId>

      <version>${gae.version}</version>

      <scope>test</scope>

    </dependency>

    <!-- End Google App Engine dependencies -->

  </dependencies>


  <build>

    <plugins>

      <plugin>

        <groupId>org.codehaus.mojo</groupId>

        <artifactId>gwt-maven-plugin</artifactId>

        <executions>

          <execution>

            <phase>prepare-package</phase>

            <goals>

              <goal>compile</goal>

            </goals>

          </execution>

        </executions>

      </plugin>


      <!-- allows testing of HTML backend via: mvn integration-test -Phtml -->

      <plugin>

        <groupId>org.mortbay.jetty</groupId>

        <artifactId>jetty-maven-plugin</artifactId>

        <version>8.0.0.v20110901</version>

        <configuration>

          <webApp>

            ${project.basedir}/target/${project.artifactId}-${project.version}

          </webApp>

        </configuration>

        <executions>

          <execution>

            <id>test-html</id>

            <phase>integration-test</phase>

            <goals>

              <goal>run-exploded</goal>

            </goals>

          </execution>

        </executions>

      </plugin>


      <plugin>

        <artifactId>maven-eclipse-plugin</artifactId>

        <version>2.8</version>

        <configuration>

          <downloadSources>true</downloadSources>

          <downloadJavadocs>false</downloadJavadocs>

          <wtpversion>2.0</wtpversion>

          <additionalBuildcommands>

            <buildCommand>

              <name>com.google.gwt.eclipse.core.gwtProjectValidator</name>

            </buildCommand>

          </additionalBuildcommands>

          <additionalProjectnatures>

            <projectnature>com.google.gwt.eclipse.core.gwtNature</projectnature>

            <!-- This nature can be removed if you don't wish to deploy to Google App Engine -->

            <projectnature>com.google.appengine.eclipse.core.gaeNature</projectnature>

          </additionalProjectnatures>

        </configuration>

      </plugin>


      <!-- Start Google App Engine plugin configuration -->

      <!-- This can be removed if you don't wish to deploy to Google App Engine -->

      <plugin>

        <groupId>net.kindleit</groupId>

        <artifactId>maven-gae-plugin</artifactId>

        <version>0.9.2</version>

        <dependencies>

          <!-- Use explicit dependency on gae-runtime here, so we can specify GAE SDK version -->

          <dependency>

            <groupId>net.kindleit</groupId>

            <artifactId>gae-runtime</artifactId>

            <version>${gae.version}</version>

            <type>pom</type>

          </dependency>

        </dependencies>

        <executions>

          <execution>

            <id />

            <phase>validate</phase>

            <goals>

              <goal>unpack</goal>

            </goals>

          </execution>

        </executions>

      </plugin>

      <!-- End Google App Engine plugin configuration -->

    </plugins>


    <!-- Start Google App Engine Eclipse plugin configuration -->

    <!-- This can be removed if you don't wish to deploy to Google App Engine -->

    <pluginManagement>

      <plugins>

        <!-- This plugin's configuration is used to store Eclipse m2e settings only. -->

        <!-- It has no influence on the Maven build itself.-->

        <plugin>

          <groupId>org.eclipse.m2e</groupId>

          <artifactId>lifecycle-mapping</artifactId>

          <version>1.0.0</version>

          <configuration>

            <lifecycleMappingMetadata>

              <pluginExecutions>

                <pluginExecution>

                  <pluginExecutionFilter>

                    <groupId>net.kindleit</groupId>

                    <artifactId>maven-gae-plugin</artifactId>

                    <versionRange>[0.9.2,)</versionRange>

                    <goals>

                      <goal>unpack</goal>

                    </goals>

                  </pluginExecutionFilter>

                  <action>

                    <execute />

                  </action>

                </pluginExecution>

                <pluginExecution>

                  <pluginExecutionFilter>

                    <groupId>org.apache.maven.plugins</groupId>

                    <artifactId>maven-war-plugin</artifactId>

                    <versionRange>[2.1.1,)</versionRange>

                    <goals>

                      <goal>exploded</goal>

                    </goals>

                  </pluginExecutionFilter>

                  <action>

                    <execute />

                  </action>

                </pluginExecution>

              </pluginExecutions>

            </lifecycleMappingMetadata>

          </configuration>

        </plugin>

      </plugins>

    </pluginManagement>

    <!-- End Google App Engine plugin configuration -->

  </build>

</project>

Epilol

unread,
Oct 17, 2013, 5:47:14 PM10/17/13
to pl...@googlegroups.com
this is really weird... I just moved the interface Navigable to the main package to test. It didn't work, I moved it back to the old package by pressing ctrl + z. Now if I try to compile html I get this error...




What's happening?

Daniel Gerson

unread,
Oct 17, 2013, 5:58:20 PM10/17/13
to pl...@googlegroups.com
There is no way to use gson with gwt!

From the stackoverflow question:

Gson uses Java features that are not supported in GWT such as reflection. Thus it is not possible to use Gson in GWT client side code.

There are other solutions suggested on the question. Or use playn.core.Json as in

Never used it, but works in the demo.

DMG

Epilol

unread,
Oct 17, 2013, 6:04:49 PM10/17/13
to pl...@googlegroups.com
thanks Daniel.

But what about this guy that said he made gson for gwt? (Last post in the stackoverflow topic you linked me). anything reliable ? :P

Daniel Gerson

unread,
Oct 17, 2013, 6:23:52 PM10/17/13
to pl...@googlegroups.com


On Friday, October 18, 2013 12:04:49 AM UTC+2, Epilol wrote:
thanks Daniel.

But what about this guy that said he made gson for gwt? (Last post in the stackoverflow topic you linked me). anything reliable ? :P


Who knows? But it's GPL, so if you plan on monetizing your game, I wouldn't even look at it. 

Epilol

unread,
Oct 17, 2013, 6:26:32 PM10/17/13
to pl...@googlegroups.com
ok thanks Daniel. I still haven't fixed the problem btw :( 
I tried to comment all the instructions using gson, but I still get the error for all those classes (except gson ofc)

Epilol

unread,
Oct 17, 2013, 8:00:06 PM10/17/13
to pl...@googlegroups.com
update: I guess the problem has to do with the compiler not reading the packages outside of the main class (the one with init() method I mean)

I tryed making an empty class Test(without nothing, not even a field or a constructor). If I keep it in the same package as my main class I don't get any error, if I move it out of the main package I get:

[INFO]       [ERROR] Line 73: No source code is available for type progetto.saga.map.Test ; did you forget to inherit a required module?

at line 73 I just do Test test = new Test()

this is driving me crazy, any idea?

Daniel Gerson

unread,
Oct 18, 2013, 2:41:02 AM10/18/13
to pl...@googlegroups.com
update: I guess the problem has to do with the compiler not reading the packages outside of the main class (the one with init() method I mean)

I tryed making an empty class Test(without nothing, not even a field or a constructor). If I keep it in the same package as my main class I don't get any error, if I move it out of the main package I get:

[INFO]       [ERROR] Line 73: No source code is available for type progetto.saga.map.Test ; did you forget to inherit a required module?

at line 73 I just do Test test = new Test()

this is driving me crazy, any idea?


You code is in the wrong package!
If you look at your GWT module, you include source code in the package .core

<source path='core'/>

 This is true for your main file

saga/progetto/tesi/core/TheKnowledgeTowers.java

but not true for the other ones. You'll either have to add multiple paths to your gwt module...
or the recommended and default way is to move all your packages (entity, navigable, etc) underneath core.

DMG

Epilol

unread,
Oct 18, 2013, 6:51:09 AM10/18/13
to pl...@googlegroups.com
thanks a lot Daniel, now it works :D
Now I need to remove Gson! 
Basically I was using it to generate all the game maps by creating an instance of a data object which contains all the information to create the map.
For example my Gson had a list of EnemyData which contains all the information about each enemy needed by the map (coordinates, if it has to respawn, if it has to drop items, etc..) or a PlayerData field containing the player starting coordinates.
The thing is since it was using reflection, the code looked nice and small (I just had to get the information from the class Data, instead of using one hundred if I mean)
Is there another json class which allows me to do the same as Gson and to understand the file I made and which is supported by gwt or do I need to parse a big string on the client to generate the map? This last approach would make the code look very chaotic unfortunally

thanks :)

Daniel Gerson

unread,
Oct 18, 2013, 8:45:02 AM10/18/13
to pl...@googlegroups.com

Is there another json class which allows me to do the same as Gson and to understand the file I made and which is supported by gwt or do I need to parse a big string on the client to generate the map? This last approach would make the code look very chaotic unfortunally


Did you read through the Stackoverflow answer?
What's wrong with the chosen answer?... i.e.

DMG

Daniel Gerson

unread,
Oct 18, 2013, 9:09:40 AM10/18/13
to pl...@googlegroups.com
You can also use gwt-rpc or RequestFactory to get your objects from the server... I've never used autobean wrapping explicitly myself so I'm a little unfamiliar about the trade-offs.

DMG

Epilol

unread,
Oct 18, 2013, 9:44:38 AM10/18/13
to pl...@googlegroups.com
ye I just wanted to get sure it was ok to use it :)
thanks!

Daniel Gerson

unread,
Oct 18, 2013, 12:23:42 PM10/18/13
to pl...@googlegroups.com
ye I just wanted to get sure it was ok to use it :)
thanks!

If it doesn't work, I offer to return all the funds I've received ;-)

DMG

Epilol

unread,
Oct 19, 2013, 11:36:01 AM10/19/13
to pl...@googlegroups.com
thanks again Daniel, Autobean works like a charm :P It's like magic shah

Jeramie Risinger

unread,
Oct 19, 2013, 4:25:56 PM10/19/13
to pl...@googlegroups.com
Another possibility for GWT and json is to use the PlayN built in JSON parser.  I ran into the same issues parsing JSON myself, though I tried using Jackson without realizing that it would not work with GWT.

Daniel Gerson

unread,
Oct 20, 2013, 7:10:40 AM10/20/13
to pl...@googlegroups.com
Another possibility for GWT and json is to use the PlayN built in JSON parser.  I ran into the same issues parsing JSON myself, though I tried using Jackson without realizing that it would not work with GWT.


Yes, I mentioned the playn json parser earlier on this thread here https://groups.google.com/d/msg/playn/tEDmKP2DD5I/2xxXL0icp6IJ

However, given that Autobean can do both directions, and really can remove a lot of boiler plate, I think it probably supersedes all other recommendations for json and gwt from this point.

DMG 

Jeramie Risinger

unread,
Oct 20, 2013, 5:53:58 PM10/20/13
to pl...@googlegroups.com
Ah, I completely missed that.  I'll have to check out the autobean if it's the true hotness.  :)

Epilol

unread,
Oct 20, 2013, 9:09:51 PM10/20/13
to pl...@googlegroups.com
by the way guys do you know why my game works perfectly on all the browsers but safari? If I run it on safari the main menu is bugged, the buttons aren't visible and nothing happens. Any idea how can I find out what's going on?

Jeramie Risinger

unread,
Oct 20, 2013, 10:49:09 PM10/20/13
to pl...@googlegroups.com
I have to admit, I haven't tried Safari at all.  I'll try my stuff on it next chance I get and see if I find anything helpful.

Epilol

unread,
Oct 21, 2013, 6:29:14 AM10/21/13
to pl...@googlegroups.com
Thanks :)

Jeramie Risinger

unread,
Oct 21, 2013, 12:20:33 PM10/21/13
to pl...@googlegroups.com
Just tried out my stuff with Safari, I didn't see any oddities/issues.  Do you have yours publicly available on app engine or something?  Not sure if I would be able to tell much by just looking at it, though.  Someone else might.  :)

Epilol

unread,
Oct 21, 2013, 5:12:53 PM10/21/13
to pl...@googlegroups.com
at the moment I have it in localhost, but as soon as I update it on the web I will provide you a link :P thanks!

Brigt Vik

unread,
Oct 22, 2013, 4:11:30 AM10/22/13
to pl...@googlegroups.com
You can get a DNS entry for your dev computer for the very low price of free. I use that to have my dev computer be a makeshift multiplayer server for my game, allowing testers to play against eachother with their own devices in various locations. I use No-Ip, and I'm sure there are also other services. In No-Ip's case, the only "price" I have to pay is to visit a web page monthly to confirm my continued usage of the DNS entry.

This is assuming you have access to making a hole in your firewall and/or setting up a virtual server on your router. If not, people won't reach your game.

Epilol

unread,
Oct 22, 2013, 10:53:53 AM10/22/13
to pl...@googlegroups.com
Thanks a lot Brigt, I will take a look at that for sure :)

Jeramie Risinger

unread,
Oct 22, 2013, 4:52:01 PM10/22/13
to pl...@googlegroups.com
Also, if you register for app engine, you can host there for free.  You only have caps on number of requests that it'll serve up per 24hr period.  I found using the getting started guide for publishing to appEngine pretty easy to follow.

Epilol

unread,
Oct 22, 2013, 5:24:34 PM10/22/13
to pl...@googlegroups.com
oh nice thanks, I will check for it as well :)

By the way guys is it normal that I'm having some bugs on html which I don't have in java?

For example if I press a key on my keyboard and hold it for more than 2-3 seconds to move my character and then I release the button the game acts like the key is still pressed and the character keeps moving. It's weird because in the onMouseUp method of the mouse listener I remove the key.

Also the method that inits the buttons in the game menu isn't called in the html version.

What's happening? :O

Brigt Vik

unread,
Oct 22, 2013, 5:37:00 PM10/22/13
to pl...@googlegroups.com
I do have some bugs which seem to be specific to my HTML version, but nothing of the sort you are seeing. Mine appear to concern my use of SurfaceImage, possibly due to migrating incorrectly from using SurfaceLayer back when. Are you perchance seeing any errors in Firebug / the Chrome console?

Epilol

unread,
Oct 22, 2013, 6:28:10 PM10/22/13
to pl...@googlegroups.com
yup

on chrome this:

Uncaught TypeError: Cannot read property 'nullField' of null

on chrome now it's magically working but it's going REALLY slow (like 5fps or so) and I'm getting this:

ReferenceError: Can't find variable: chrome
ReferenceError: Can't find variable: safari
TypeError: 'null' is not an object (evaluating 'null.nullField')

Epilol

unread,
Oct 22, 2013, 7:28:12 PM10/22/13
to pl...@googlegroups.com
little update.

I still haven't fixed the nullField error (and the buttons are still invisible in the menu), but I fixed the safari bug and the keyboard bug
If anyone will get such problem basically adding (on mouse down) and removing (on mouse up) keys from a list of Key. A simple check if the list contained the enum fixed the problem (I'd really like to know why, as I can't really understand)

Epilol

unread,
Oct 24, 2013, 7:22:38 AM10/24/13
to pl...@googlegroups.com
I think I found the problem, basically in html it ignores this for:

for (ButtonType buttonType : ButtonType.values())


any idea why I can't iterate on enum values?

Brigt Vik

unread,
Oct 24, 2013, 7:48:06 AM10/24/13
to pl...@googlegroups.com
I suppose you've considered this already, but my first reaction is that the enumeration could be empty, meaning the for loop will have nothing to do. I don't know about this ButtonType class, so I don't know if this is a part of some library or your own class. If the latter, could the code populating the stuff underlying values() be failing?

Epilol

unread,
Oct 24, 2013, 8:08:26 AM10/24/13
to pl...@googlegroups.com
the ButtonType class is my own enum.
Actually I'm not sure anymore it has to do with values(). It works in another part of the code...
But still it's not initializing my buttons in the game menu, while in java it does.

This is the code that doesn't work:

        public void initButtons(ButtonType menuButton)

{

for (ButtonType buttonType : ButtonType.values())

{

Text charText = null;

if (menuButton == buttonType)

charText = new Text(buttonType.getText(), "Gabriola", Style.BOLD, 30, 0xFFFFFFFF, true);

else

charText = new Text(buttonType.getText(), "Gabriola", Style.BOLD, 30, 0xFFFFFFFF, false);


charText.setTranslation(BUTTON_POINT.x(), BUTTON_POINT.y() + 45 * buttonType.ordinal());

charText.setDepth(8.0f);

charText.init();

buttons.put(charText, gameLoop.getMenu().get(buttonType.ordinal()));

}

Text resumeText = new Text("Resume", "Gabriola", Style.BOLD, 30, 0xFFFFFFFF, false);

resumeText.setTranslation(BUTTON_POINT.x(), BUTTON_POINT.y() + 45 * buttons.size());

resumeText.setDepth(8.0f);

resumeText.init();

buttons.put(resumeText, this);

}


the problem is that also the resume text (which is outside of the for) doesn't work.

thanks!

Epilol

unread,
Oct 24, 2013, 8:17:46 AM10/24/13
to pl...@googlegroups.com
looks like the buttons Map in which I put (text,this) is always empty :O

Epilol

unread,
Oct 24, 2013, 9:24:12 AM10/24/13
to pl...@googlegroups.com
oh my god, this is unbelievable. I finally fixed the problem and now it's working. If anyone can explain me why this was bugging the game I will appreciate it as it doesn't make any sense to me.

Basically when I was creating the text here:

if (menuButton == buttonType)

charText = new Text(buttonType.getText(), "Gabriola", Style.BOLD, 30, 0xFFFFFFFF, true);

else

charText = new Text(buttonType.getText(), "Gabriola", Style.BOLD, 30, 0xFFFFFFFF, false);


the html compiler was acting like  if there was a break; in the for()

This is the Text constructor (which uses tripleplay)

public Text(String text, String font, Style style, float size, int color, boolean underlined)

{

this.text = text;

this.color = color;

textFont = graphics().createFont(font, style, size);

config = new TextConfig(new TextFormat().withFont(textFont), color).withUnderline(underlined);

textLayer = config.toLayer(text);

textLayer.setVisible(false);

}


I removed the underlined boolean and the withUnderline(underlined) method  and now it works

Andres Martinez Quijano

unread,
Oct 24, 2013, 12:08:26 PM10/24/13
to pl...@googlegroups.com
I seriously doubt that was what was causing the problems...
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "PlayN" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to playn+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Michael Bayne

unread,
Oct 24, 2013, 1:19:31 PM10/24/13
to pl...@googlegroups.com

On Thu, Oct 24, 2013 at 6:24 AM, Epilol <epi...@gmail.com> wrote:

if (menuButton == buttonType)

charText = new Text(buttonType.getText(), "Gabriola", Style.BOLD, 30, 0xFFFFFFFF, true);

else

charText = new Text(buttonType.getText(), "Gabriola", Style.BOLD, 30, 0xFFFFFFFF, false);


Wow, that burns my eyes. Tip from the pros:

charText = new Text(buttonType.getText(), "Gabriola", Style.BOLD, 30, 0xFFFFFFFF,
                    menuButton == buttonType);

However, I agree that this probably had nothing to do with your problem.

Epilol

unread,
Oct 24, 2013, 3:20:45 PM10/24/13
to pl...@googlegroups.com
well actually that's it. if I just remove the underline it works. If I keep it then I get the bug, maybe it's  not supported by HTML? 

Michael Bayne

unread,
Oct 24, 2013, 3:48:33 PM10/24/13
to pl...@googlegroups.com

On Thu, Oct 24, 2013 at 12:20 PM, Epilol <epi...@gmail.com> wrote:
well actually that's it. if I just remove the underline it works. If I keep it then I get the bug, maybe it's  not supported by HTML? 

I stand corrected. The ultimate cause is this:

class HtmlTextLayout extends AbstractTextLayout {
  @Override
  public Rectangle lineBounds(int line) {
    // TODO
    return null;
  }


which causes underlined text rendering to fail. I apologize for the poor failure mode induced by this not yet implemented code. I will flog the appropriate engineer.


Epilol

unread,
Oct 24, 2013, 4:07:32 PM10/24/13
to pl...@googlegroups.com
thanks a lot Michael :)
Reply all
Reply to author
Forward
0 new messages