![]() ![]() I this case, we wont do that because the linear filtering doesn’t work on the edges of the image.Ĭan be useful to have a small transparent border around your images. Packer can optionally strip this away to save on image size, while keeping track of the original image If you look at the individual images then you’ll see that each card has a transparent border. This will give a somewhat blurry result, but prevents details (like the thin line on the cards) fromĭisappearing because of scaled texture sampling. Besides that I also set the filterMin and filterMag parameters to Linear. You’ll need to adjust at least the maxWidth and maxHeight Note that you cant simply rename the files, because I named them carddeck.atlas and carddeck.png. Through the process of packing them, but you should end up with two files, an. In fact, all of those 58 imagesįit in one 2048x2048 sized image, with some room left for some other images as needed. That allows us to pack multiple images into one or more bigger images. Unfortunately this is not very practical to work with for a game.Ĭonstantly switching between images adds quite some overhead. It offers more flexibility and allows optimations like packing multiple animations, as we’ll see next. Yourself manually splitting up a texture in equally sized regions, then consider using indexers instead. Not the least for spritesheet animations. Indexers are very useful in a lot of cases. Some back side images, which I named back_1.png, back_2.png, etc. This way we can later get all “clubs” images sorted on index. For example: clubs_01.png,Ĭlubs_02.png, clubs_03.png etc. Them a meaningfull name and append them with and underscore and number. We have to work with quite some images, so Next we need to make sure the assets are correctly named. So, unless you see the cards taking up a third of the screenshot, you might notice that theyĪre (quite heavily) downscaled. The process of the actual resizing, for which I’ve usedītw, for my convenience, in this tutorial I’ll be showing screenshots or videos taken at a resolution Keeping aspect ratio, that gives us 200 * 1063 / 768 = ~277 pixels in height. So a size of 200 pixels wide for a card should be To show quite a few playing cards next to each. Let’s say that a typical screen is 1280 or 1920 pixels wide and we want Make sure your assets are correctly sizedįor our use case these images are way too big, they are practically the same size as entire screen.Īlways make sure that your assets or not too big or too small. In this case we have to work with quite large. This allows you to easily generate other assets for other resolutions etc. Basically a huge set of images of your standard card deck.Īlways make sure to keep the source files of your assets. Where you can find, usually, free to use assets. In this tutorial we’ll be focusing on getting things done. This is a relatively low entry tutorial, but some experience withĪnd a runnable test of this tutorial can be found on this github repository. ![]() Obtaining and preparing the assets up until using a perspective camera and positioning and rotating ![]() We will not look into the actual game logic, but only focus on the graphics side. In this blog post I will show you how to use real 3D perspective in a typical 2D card game. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |