Posts Tagged ‘Texture’
Unity: assigning a texture to the cursor
Posted by Dimitri | Filed under Programming
Unity 4.0 has been released last week and there are tons of new useful features to explore. One of those new fresh features is the option to set a Texture2D as a cursor. Although the code featured at the official documentation is extremely simple and explains how to achieve that with the OnMouseEnter() and the OnMouseExit() method, it will only work when the cursor is colliding with the 3D object in screen space. However, what if the game requires a default customized cursor that lasts throughout the whole level (or game)?
Arrows Live Wallpaper, an arrow flood on your screen!
Posted by Dimitri | Filed under Featured, Projects
Update: Get the FULL version ! Or, get the FREE version!
For the last couple of weeks, I’ve been creating an Android live wallpaper and preparing its release. It’s called Arrows Live Wallpaper. As the name implies, it’s an Android live wallpaper that consists of colorful arrows that are constantly moving around. At the background, there’s a equally colorful image that fills up the entire screen adding to the overall effect. Also, you will get lots of options to customize just about everything on the wallpaper, such as the theme, color scheme, arrows speed and battery consumption. Here’s a screenshot:
Unity: displaying the video input from multiple webcams
Posted by Dimitri | Filed under Programming
This post explains how to capture the images from a web camera connected to the computer and use them as a texture in Unity. However, this tutorial focuses on switching between the video inputs from different webcams attached to desktop computers (PC and Mac). However it should work on Android with some minor modifications. The code featured in this article has been developed and tested using a free license of Unity 3.5.3f3. As usual an example project with all the code featured in this article is available for download at the end of the post.
Before explaining how to choose from a list of multiple connected webcams to render from, let’s see how to preview the captured images from a single camera. Doing that in Unity is very simple and it can be achieved with just a few lines of code. Take a look at this C# script: (more…)
Android: rendering a path with a Bitmap fill
Posted by Dimitri | Filed under Programming
This Android tutorial shows how to render a Path that is filled by a Bitmap and displays stroke in a different color. It also explains how to manipulate the texture coordinates to make it independent of the position of the path, just like a mask, but without using any of the PorterDuff rendering modes. The code featured in this code was created and tested on Android 2.1, both on a real and at an emulated device.
Here’s a video of the example application in action:
If you can’t play the video, don’t worry: there is a screenshot of the application at the bottom of this post.
Unity: Animated texture from image sequence – Part 2
Posted by Dimitri | Filed under Featured, Programming
The second and last tutorial of a series that explains how to create an animated texture from a sequence of images in the Unity engine. This is a direct follow up of the previous post, so if you’ve missed it, please read it here. As the first post, the same disclaimer applies: for animating a texture with a small number of frames and/or small frame sizes, it’s better to join them into a single sprite sheet image and use this script. For video playback, use the MovieTexture (only available at Unity Pro).
Just as a reminder, this series is about creating an animated texture from multiple image files. In the previous post, a script loaded all image files into an array and then changed the texture of the game object it was attached to. (more…)