People Playground

People Playground

Not enough ratings
HD-sprites or how to make normal size sprite
By Chin
This tutorial describes the process of scaling sprites to normal size using the example of a mod I created. And some modding tips.
   
Award
Favorite
Favorited
Unfavorite
Making sprites
In-game sprites


The game uses small sprites (for example, the Human sprite is 18x79px), such sprites immediately have the original size, which is ideal for the PPG. But due to their small size they are of very low quality.

All in-game sprites you can get it on the studio minus site.
In-game sprites[www.studiominus.nl]


The PPG does not prohibit making large sprites, but since... scaling in the game is done by pixels, such sprites initially have a size like to the size in pixels


Tip for creating a sprite


Sprites are best created in sizes that have even sizes,
like in my mod - it has the size 340х170px
This is not required, but it can help avoid scaling issues.


Sprite scaling
Standard sprite


So you've created a sprite that is larger than the in-game sprites. As a result, in PPG sprite will look like this:



To create a sprite that is not pixel-sized, you need to apply scaling to it:
The f parameter is responsible for the sprite scale unit
Actually, the larger the value, the less large the sprite will be.


issues


This may not be true, but scaling should be applied not only to the sprite itself, but also to the thumbnail.



Code snippet


//thumbnail scale ThumbnailOverride = ModAPI.LoadSprite("thumbnail_path", nf), //sprite scale Instance.GetComponent<SpriteRenderer>().sprite = ModAPI.LoadSprite("sprite_path", nf);
Adding lights
Creating a light sprite


In order for your sprite to display light, you need to create a sprite with lights.


Tip


Create a light sprite the same size as the original sprite. It’s best to take the original sprite in the editor and make a layer out of it, and apply light on this layer.
Also, the light source is applied the same scale as the original sprite (via the f parameter)



To do this, choose a suitable color and simply apply it to the places that will need to emit light.
Example sprite:


Code snippet
To add a light sprite in the game, you need to write the following code in the AfterSpawn object code:
//Create childObject var childObject = new GameObject("NAME"); //object transformation is not necessary if the dimensions of the light source sprite are equal to the //original sprite childObject.transform.SetParent(Instance.transform); childObject.transform.localPosition = new Vector3(nf, nf); //sprite position childObject.transform.localScale = new Vector3(nf, nf); //sprite scale //Adding lights sprite var childSprite = childObject.AddComponent<SpriteRenderer>(); childSprite.sprite = ModAPI.LoadSprite("light_sourse_sprite_path", nf); childSprite.sharedMaterial = ModAPI.FindMaterial("VeryBright");//Adding glow


Existing light sources.
Also, if the original item is an item with preset lights, they can be removed by adding this code:
foreach (Transform child in Instance.transform) if (child.name.Contains("light")) GameObject.Destroy(child.gameObject);
Color of the description or title in the menu
Tip


In PPG, in addition to mod tags, you can add color to the text in the title or description.
You can do this using
<color=#HEX>
To do this, simply add a <color> tag with the HEX code of the desired color to the title or description.

_________
And so, you have learned the basics of scaling and some features.
If you want to support the author, like and add to your favorite guide, and also subscribe to my mod:

Dominator Mod by k_falke.
Perhaps everything I just wrote here doesn’t work/is crooked/the code is crap/and in general everyone knows about it.
But I spent 4 hours searching for how to make a normal-sized sprite, so I hope it helps you.