Advertisement
Archives

You are currently browsing the archives for the Uncategorized category.

Archive for the ‘Uncategorized’ Category

Quick Tip: LibGDX – GWT – Mouse Pointer

Today, I was working with the GWT backend for LibGDX and in this particular game I was using mouse drag. I was met with an unsightly text-selection cursor on my mouse. It made me sad, and I bet it’d make you sad too.

Here’s one way to fix that…

The default index that the LibGDX Setup creates is pretty basic, which is good as it makes no assumptions as to what you want. Here’s an example:

<!doctype html>
<html>
	<head>
		<title>lines</title>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	</head>
	
	<body>
		<div align="center" id="embed-com.mobi.lines.Lines"></div>
		<script type="text/javascript" src="com.mobi.lines.Lines/com.mobi.lines.Lines.nocache.js"></script>
	</body>
</html>

Unmodified, this allows the aforementioned text-selection cursor to appear upon drag operations. If you don’t want that, you can add the following style (to the head) and script (at the end of the body) tags to your index.html:

<style>
	canvas { cursor: pointer; }
</style>

and

<script>
	function handleMouseDown(evt) {
	  evt.preventDefault();
	  evt.stopPropagation();
	  evt.target.style.cursor = 'pointer';
	}
	function handleMouseUp(evt) {
	  evt.preventDefault();
	  evt.stopPropagation();
	  evt.target.style.cursor = '';
	}
	document.getElementById('embed-com.mobi.lines.Lines').addEventListener('mousedown', handleMouseDown, false);
	document.getElementById('embed-com.mobi.lines.Lines').addEventListener('mouseup', handleMouseUp, false);
</script>

In the end, you should have something like this:

<!doctype html>
<html>
	<head>
		<title>lines</title>
		<meta http-equiv="content-type" content="text/html; charset=UTF-8">
		<style>
			canvas { cursor: pointer; }
		</style>
	</head>
	
	<body>
		<div align="center" id="embed-com.mobi.lines.Lines"></div>
		<script type="text/javascript" src="com.mobi.lines.Lines/com.mobi.lines.Lines.nocache.js"></script>
		
		<script>
			function handleMouseDown(evt) {
			  evt.preventDefault();
			  evt.stopPropagation();
			  evt.target.style.cursor = 'pointer';
			}
			function handleMouseUp(evt) {
			  evt.preventDefault();
			  evt.stopPropagation();
			  evt.target.style.cursor = '';
			}
			document.getElementById('embed-com.mobi.lines.Lines').addEventListener('mousedown', handleMouseDown, false);
			document.getElementById('embed-com.mobi.lines.Lines').addEventListener('mouseup', handleMouseUp, false);
		</script>
		
	</body>
</html>

I know, it’s not exactly earth-shattering stuff here, but I hope it can help someone.

How Not To Ask A Developer For Updates

Recently, we received an email from a customer looking for updates on BarTor. OK, not all that uncommon right? The thing that stood out was the approach this customer took in asking for these updates. Lets just say that it was shockingly hostile, especially for a first contact email. Rather than explaining it, I will just include the email here along with my response.
Read the rest of this entry »

My Three-Day Review Of The Motorola CLIQ

After having my Motorola CLIQ for three days, I decided to write down my thoughts and opinions of the phone and specifically focus on those aspects that are (in my opinion) of interest to current Android users who are looking at the CLIQ as a possible upgrade device. Read the rest of this entry »

Sialia

Coming soon…

sialia

My First Blog Post… Ever.

Alright. Let me first start off by saying that I am not a blogger. As a matter of fact, on many occasions I have flat out denied having any real use for a blog. And that is still basically true. Most times I find myself struggling to find enough to say to my friends and family, let alone a bunch of strangers on the Internet. Be that as it may, here I am, staring at a blank page, and writing about how I don’t think I need a blog. So, why am I here?

I feel it is time to try to connect better with the world in which I spend so much of my time and which has come to affect all of our lives so deeply. Yes, I am talking about the Internet, or rather, the Web. But that is merely semantics, right?

So, what am I going to talk about here? I don’t know… You tell me, what do you want to hear about? I have  a loose plan to write about my experiences in software development. I can make no guarantees as to what that might look like, or ultimately amount to, but I hope it will be something good. Again, I look to you for encouragement and suggestions.

What I can tell you is this: There will be heavy focus on Android development here. There are a number of reasons for this: First, I find it most interesting at this point in time, and I spend a lot of time doing it. Second, the Android community has been such a big help to me, and I feel it is time for me to give back to that community. Lastly, and this is somewhat selfish of me but whatever, I feel that Android provides the best opportunity for me to develop a lasting network, and help to drive my career in the way that I want it to.

Aside from Android I also hope to cover other technologies with which I work to varying degrees, including Microsoft .NET, Adobe Flex, and others.

So… Welcome. I hope you find something you can get interested in and I appreciate any comments, suggestions or anything else you might have to say.

Justin
nEx.Software