Lynda.com: Become a Unity 2D Developer (Day 6)
UNITY 5: 2D BUILDING A TILE MAP EDITOR
(...continued part II)
Displaying a Texutre2D in a Window
In order to display the selected texture within the Tile Picker window, a custom script was created. This script focuses on determining if there is a selected tile. From there, it then displays the texture withing the Tile Picker window. It is important to note that their can be a bit of a rendering delay. However, once the script catches up, it will immediately display the selected texture withing the Tile Picker window
Scaling the Texture 2d
Now that the selected texture is displaying correctly, it is time to improve the experience by allowing the texture to scale within the Tile Picker window. In order to accomplish this, I had to setup a script to be able to scale the texture. In addition, the Tile Picker window will now be able to zoom in on the texture up to x5 the original size.
Adding Scrolling to the Window
In order to improve the visual experience, it is important to include an option to scale graphics, specifically the textures. This is a invaluable feature to the GUI as designers/developers will be able to easily distinguish the various the (potentially) loaded textures and images. Unfortunately, the Tile Picker window does not utilize scroll bars by default. Below is the C# script used to generate the scroll bars.
Highlighting the Selected Tile
When it comes usability, highlighting content to inform the user is a great way to keep things visually organized. It is a minor visual aspect that is often taken for granted. Adding a visual queue to an on-going project will only enhance the overall experience, specifically for the designers/developers for Unity. The C# script adds a solid color filled box onto the selected texture within the Tile Picker. At this time, the visual queue is a white square located on the top-left of the texture.
Styling the Title Picker Highlight
Despite all of my best efforts, I was unable to execute this code successfully. The current behavior is that a white box is added to the top right corner. However, the new code is supposed to colorize them. Unfortunately, I am unable to implement the color indicator successfully. I have thoroughly reviewed the code in comparison to the Lynda.com example and it does not compile correctly.
Moving the Highlight
It is quite satisfying to finally get something to work. Luckily, I was able to move towards the next lesson, even though I was unsuccessful in getting the highlight script to work. Nevertheless, to my surprise, I was able to get the Moving the Highlight function working as expected. At this time, it is not fully flushed out. The user is able to not only select individual sections of the texture, the area outside of the texture has become select-able as well.
Saving the Title Selection
In the previous tutorial, I was able to create a script that allowed the user to select a texture within the Tile Picker window. Unfortunately, the current behavior is quite unacceptable. It currently allows the user to select any area of the Tile Picker window, regardless if it is the image or not. The script below helps limit the user access to the intended texture selection.
(...continued part II)
Displaying a Texutre2D in a Window
In order to display the selected texture within the Tile Picker window, a custom script was created. This script focuses on determining if there is a selected tile. From there, it then displays the texture withing the Tile Picker window. It is important to note that their can be a bit of a rendering delay. However, once the script catches up, it will immediately display the selected texture withing the Tile Picker window
Scaling the Texture 2d
Now that the selected texture is displaying correctly, it is time to improve the experience by allowing the texture to scale within the Tile Picker window. In order to accomplish this, I had to setup a script to be able to scale the texture. In addition, the Tile Picker window will now be able to zoom in on the texture up to x5 the original size.
Adding Scrolling to the Window
In order to improve the visual experience, it is important to include an option to scale graphics, specifically the textures. This is a invaluable feature to the GUI as designers/developers will be able to easily distinguish the various the (potentially) loaded textures and images. Unfortunately, the Tile Picker window does not utilize scroll bars by default. Below is the C# script used to generate the scroll bars.
Highlighting the Selected Tile
When it comes usability, highlighting content to inform the user is a great way to keep things visually organized. It is a minor visual aspect that is often taken for granted. Adding a visual queue to an on-going project will only enhance the overall experience, specifically for the designers/developers for Unity. The C# script adds a solid color filled box onto the selected texture within the Tile Picker. At this time, the visual queue is a white square located on the top-left of the texture.
Despite all of my best efforts, I was unable to execute this code successfully. The current behavior is that a white box is added to the top right corner. However, the new code is supposed to colorize them. Unfortunately, I am unable to implement the color indicator successfully. I have thoroughly reviewed the code in comparison to the Lynda.com example and it does not compile correctly.
Moving the Highlight
It is quite satisfying to finally get something to work. Luckily, I was able to move towards the next lesson, even though I was unsuccessful in getting the highlight script to work. Nevertheless, to my surprise, I was able to get the Moving the Highlight function working as expected. At this time, it is not fully flushed out. The user is able to not only select individual sections of the texture, the area outside of the texture has become select-able as well.
Saving the Title Selection
In the previous tutorial, I was able to create a script that allowed the user to select a texture within the Tile Picker window. Unfortunately, the current behavior is quite unacceptable. It currently allows the user to select any area of the Tile Picker window, regardless if it is the image or not. The script below helps limit the user access to the intended texture selection.













Comments
Post a Comment