Bzoing Part 2: Screenshot Code Tutorial
In this post, we will discuss how to take screenshots of your game in Unity. Some simple C# code can get what you need:
First, class 'ScreenShotCapture' was created in the project panel by right clicking and choosing Create > C# Script.
Variables 'fileName' and 'debugText' are input values that will show up in the inspector panel.
Checking each frame in Update(), checks for up arrow pressed. If so, takes screenshot with fileName and assigns .png as image extension. Finally, if debugText isn't nothing, the debugText is thrown to the console by calling 'InputDebug()'.
Now, I just created 'InputDebug()' for the sake of learning some technique. You can also simply put 'debugText' directly into Debug.Log() for more efficient handling.
You now want to attach this script to an empty game object in the hierarchy panel by right clicking and choosing 'Create Empty'. Name the object appropriately. Your's should look something like this:
Your inspector panel should have the screenshot script attached like this:
And that's really all there is to it. Name the screenshot photo from the inspector and any message you want displayed along with it can be instantiated with 'debugText' through the inspector. You are now ready to take screenshots using Unity directly. Great for app store distribution and making stuff like I am here. Hehe
If you have any suggestions for what you want to see, comment on this post or contact me.
Introduction: Bzoing - arcade game Part 1
Bzoing is going to be a mobile app arcade game for Android. The player must keep on catching the red sprite going across the screen until they will inevitably lose. Their score will be recorded and put on a leaderboard if they are in the top 10 player scores. Ads will be placed inside the game as a simple ad banner as well as an in-app-purchase to remove the adverts. Both integrations will monetize the game and will be discussed in later parts.
All aspects of this game will be recorded in this section under the category "Bzoing". Click that category for all parts.
This week I have started to work on a new game called "Bzoing". The GUI, physics, and game logic are almost complete. This game is in near alpha stage development as of Nov. 17, 2018.
The game icon, sound effects, and more I can't think of now will be in Part 2. Stay tuned.
If you have any suggestions for what you want to see, comment on this post.