Posts Tagged ‘Image’

Unity: How to create a GUI Sprite Sheet – Part 2

Click here to read Unity: How to create a GUI Sprite Sheet – Part 2

This is the second part of a series that will explain how to create a GUI sprite sheet for Unity. For this part, we will take the images created in the first post and import them to Unity. Also, this post features how to correctly set the images to be part of a GUI Skin object so they can be used as part of a game’s interface.

After having all images correctly placed at the sprite sheet, create a new GUI Skin by right-clicking anywhere inside the Project tab and select the following: Create->GUI Skin. Then, import the images in Unity, by dragging and dropping them inside this tab. It’s a good idea to put everything GUI related at the same folder, like this: (more…)

Unity: How to create a GUI Sprite Sheet – Part 1

Click here to read Unity: How to create a GUI Sprite Sheet – Part 1

This post is the first of a series that explains how to create a GUI sprite sheet (a.k.a. atlas map) in the Unity game engine. This map consists of buttons, text areas, backgrounds and other interface elements joined together to create various joined image files with all interface elements inside it.

Here, the focus will be on how to prepare and create this images at an image editing software, which is the most important step. The next post of this series will explain how to import these images in Unity and place them inside a GUI Skin object.

The first thing to do is to have all the GUI elements needed for the game or specific part of the game. They have to be already created before building the sprite sheet, at least their size have to be already defined. Throughout this post, the following GUI elements will be used to exemplify how to correctly join the images together:

(more…)

Android: Retrieving the Camera preview as a Pixel Array

Click here to read Android: Retrieving the Camera preview as a Pixel Array

This post explains how to take the live images created by Android’s camera preview feature and return them as a RGB array, that can be used to all sorts of things, like custom effects preview and real-time image filtering. This post used the CameraPreview class that already comes bundled with Android’s SDK because it has everything already set-up, that way is just a matter of inserting more code. The techniques shown here works with Android 2.1 and should work with versions 1.6 and 1.5.

The first thing to do is to import the API Demos project to your Workspace. To do that, in Eclipse, click File -> New -> Android Project. In the dialog that has just opened, give the project a name at the first field (like API Demos 8) and select ‘Create project from existing source’. Now browse to <Android SDK folder>\samples\android-7\ApiDemos. Finally, mark Android 2.1 as the Build Target and click Finish: (more…)

Unity3D: Creating a GUI with both 3D and 2D elements

Click here to read Unity3D: Creating a GUI with both 3D and 2D elements

This post explains how to create a GUI on the Unity3D game engine that has both 2D and 3D elements in it. Some may say that is just a matter of setting up a new camera with a dedicated culling mask just to render the 3D elements on the GUI. While this is partially true, adding a 2D image using a script with GUI function calls will cause the 3D image to be covered by the 2D image. That’s why this post will focus on how to set a GUI that has a 3D element with a 2D background.

As usual, at the end of the post, a Unity3D project is available for download with everything that was explained here.

(more…)

Unity3D: Non-rectangular GUI buttons – Part 3

Click here to read Unity3D: Non-rectangular GUI buttons – Part 3

This is the last post of this series, which explains how to create non-rectangular GUI buttons for Unity3D games. If you haven’t read any of the other posts yet, it is highly recommended that you take a look at part one and part two before going any further.

So, let’s start from where the second post left: we already have our Unity3D scene set up with the 3D hit test model already imported and placed inside the scene. All we have to do now is import the PNG images and make then appear as a GUI element. To do that, just drag and drop then somewhere inside the Project tab. After the images are inside Unity3D, create a GUISkin by right clicking an empty space in this same tab and select Create->GUISkin as shown: (more…)