Tigraine

Daniel Hoelbling-Inzko talks about programming

Making a whole libgdx screne2d group touchable

When placing a Group with child-controls inside a libgdx stage is is apparently impossible for the whole group to get hit-detection (click-events and touch events), instead only the children in the container will fire touch and click events.

This is something I was struggling with quite some time until I looked at the libgdx source code and found this in Actor.java:

public Actor hit (float x, float y, boolean touchable) {
    if (touchable && this.touchable != Touchable.enabled) return null;
    return x >= 0 && x < width && y >= 0 && y < height ? this : null;
}

That's how hit-detection is done in libgdx and that's also the reason why no click-events inside the groups bounds where detected. Not so much the code above, because that one works fine. But if you look at the code for scene2d.ui.Group you notice that it is overriding the hit-detection to delegate all calls to it's children, never checking for itself.

So the simple solution here was to just subclass the Group and instead of calling super.hit I brought back the hit-detection from Actor.

Hope this helps.

Filed under libgdx, java, inputs

Usability done right - Apple TV 4th Gen

My old Apple TV Remote died some years ago and I had another useless Remote from last century programmed to control it. It was ugly to say the least and I really got used to having HDMI-CIC after using the Chromecast for some time. So when I heard that the new Apple TV has HDMI-CIC (meaning the Apple-TV can control the TV and the TV can Control the Apple-TV) I decided to buy it.

So I got it yesterday and set it up - and I have to say: Wow that process was genius. Instead of having to enter all your information (Network settings, Apple-ID and password etc) you can just take your iPhone, hold it next to your Apple-TV and after a brief second the iPhone asks if you really want to set up the Apple-TV with your iPhone credentials and that's it. It configures the WiFi from your iPhone, your Apple-ID etc etc..

The process for the Chromecast was also good, but this is just way better.

Another thing I noticed right away, the perceived streaming quality on Apple-TV is way better. Instead of starting a Netflix stream instantly like on Chromecast it will buffer for a second longer, but you don't start out with a 240p stream but at least get 720p to start with. Especially at peak times when ISPs are overloaded it seemed to take forever on my Chromecast for it to wind it's way up from 240p to 720 and then 1080. Meaning sometimes I would watch almost 5 minutes until the image is bearable.

Filed under appletv, usability

Project Thesis - Introduction

I think I mentioned a time or two that I have been studying computer science at the University of Klagenfurt for quite some time now. I officially took leave from work to get my thesis done and today marks the first day of honest work on the project. To start things off I decided to write about what the project is all about and will keep a diary of stuff I learned while developing my thesis.

What's this about?

My thesis will consist of a Android game that provides a framework for researchers to test games with a purpose without having to implement the game part over and over again. The initial idea here is to create a game similar to Clicker Heroes, a simple, yet addictive time-killer game that is played in stages and can be played forever with little effort from the players. By being played in levels I am planning on injecting a mini-game into the (already mini) game for the user to earn extra-points, providing something like a boss-level. This boss-level is where the science comes in.

During the boss-level I am planning on using the users to verify the results of a deep-learning computer vision algorithm on an arbitrary image-database. This is also where I want to enable others to just take the working game and plug in their own game with a purpose to test a theory without having to do their own full-fledget game. Granted, you still have to implement your mini-game, but you don't need to make it fun - just reward your users for playing it with money and points towards the actual base game. (Similar to how some games display ads in between levels to make money, I am planning on annoying the user for science!)

alt

So how is this going to happen? The game will be open-source and available on GitHub shortly and will obviously be written in Java (yay - haven't done any serious Java in years). To speed things along I am planning on implementing it using libGdx so I get cross-platform support without too much work. Besides that I haven't decided yet on how far to take this. There will be a sample game-with-a-purpose implementation I will be testing that is probably using Caffe from Berkley Vision and Learning Center to generate a model I can then verify using the players.

The project will be open-source and reside on GitHub for everyone to follow, licensed unter Apache2 License. Please let me know if you have any questions or want to follow the progress along, you can reach me on Twitter at https://twitter.com/tigraine

Filed under thesis, projects, oss

My Photography business

Projects

dynamic css for .NET

Archives

more