Skip to content

Instantly share code, notes, and snippets.

View MobiDevelop's full-sized avatar

Justin Shapcott MobiDevelop

  • Phoenix, AZ, USA
View GitHub Profile
@MobiDevelop
MobiDevelop / Speech Bubbles - CSS
Created June 2, 2012 21:11
Speech Bubbles - CSS
/*
Speech Bubbles
Usage: Apply a class of .speech-bubble and .speech-bubble-DIRECTION
<div class="speech-bubble speech-bubble-top">Hi there</div>
*/
.speech-bubble {
position: relative;
background-color: #292929;
@MobiDevelop
MobiDevelop / Appender.java
Created September 13, 2012 15:22
A zero-allocation way to append ints and longs to a StringBuilder in Android.
/*******************************************************************************
* Copyright 2012 Justin Shapcott
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@MobiDevelop
MobiDevelop / ResolutionFileResolver.java
Created April 7, 2013 13:41
Add a pluggable ChooserStrategy to the LibGDX ResolutionFileResolver, to allow the choosing algorithm to be changed by the user.
/*******************************************************************************
* Copyright 2011 See AUTHORS file.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@MobiDevelop
MobiDevelop / ArchiveFileHandle.java
Created May 3, 2013 21:28
A ZipFile-based FileHandle implementation for LibGDX.
package com.mobidevelop.gdx.examples;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
import com.badlogic.gdx.Files.FileType;
import com.badlogic.gdx.files.FileHandle;
@MobiDevelop
MobiDevelop / PickScrollPane.java
Last active July 17, 2017 08:01
A ScrollPane that centers on a particular actor.
package com.badlogic.gdx.tests.examples;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.utils.Array;
@MobiDevelop
MobiDevelop / PagedScrollPane.java
Last active March 21, 2022 02:00
A LibGDX ScrollPane with page support. It center-locks on pages after scrolling.
package com.badlogic.gdx.tests.examples;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.utils.Array;
import com.esotericsoftware.tablelayout.Cell;
package nEx.Games.Samples;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.GL10;
import com.badlogic.gdx.graphics.OrthographicCamera;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.Texture.TextureFilter;
@MobiDevelop
MobiDevelop / Snippet.java
Created August 12, 2013 21:58
An example of downloading a file and displaying progress with the LibGDX Net module.
package com.badlogic.gdx.tests.lwjgl;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Net.HttpMethods;
import com.badlogic.gdx.Net.HttpRequest;
@MobiDevelop
MobiDevelop / ActionSnippets.java
Created August 28, 2013 14:15
Scene2D Action Snippets
public static SequenceAction getClickActon()
{
SequenceAction action = Actions.sequence(
Actions.scaleTo(1.1f, 0.9f, 0.15f),
Actions.scaleTo(0.92f, 1.08f, 0.15f),
Actions.scaleTo(1.06f, 0.94f, 0.15f),
Actions.scaleTo(0.96f, 1.04f, 0.15f),
Actions.scaleTo(1.0f, 1.0f, 0.15f),
Actions.color(Color.RED, 1.0f),
Actions.fadeOut(2.0f),
@MobiDevelop
MobiDevelop / EncryptedFileHandle.java
Created August 30, 2013 13:18
LibGDX FileHandleWrapper
package com.mobidevelop.files;
import java.io.InputStream;
import java.io.OutputStream;
import com.badlogic.gdx.files.FileHandle;
public class EncryptedFileHandle extends FileHandleWrapper {
public EncryptedFileHandle(FileHandle file) {