New answers tagged

1

Microsoft BMP files have a "monochrome" mode which uses just one bit per pixel (the file is still slightly larger due to meta-data). Note that this only applies to the actual graphic files. When you have your graphics framework unpack the image files to textures, the required texture memory might be more than 1bpp.


0

I don't know LibGDX or if it has a built in animation library, but you can be certain that it does give you the ability to scale a sprite. All you have to do is use a function of the desired graph shape to pick the size you'll render the button on each frame. For example, a linear interpolation for the scaling values will produce a perfectly smooth(err, ...


0

With absolutely no disrespect intended at all- It's important to remember that with code in Stack Exchange and especially Stack Overflow and Game Development, you can't expect the community to write code for you. You must supply at least a code example and if you don't know how to code C# for Unity then there are excellent tutorials available on the internet....


1

You should have a script attached to your Pen object. Inside this script you have references (wether public or just visible in editor) where you drag the children via editor. class YourPenScript { public GameObject Tint; public GameObject Case; public GameObject Ring; public GameObject Shape; private SpriteRenderer sr_tint; private ...


1

It may seem redundant to have a position component when the Sprite class has x and y properties but this is actually a very valid setup. First, instead of calling it a SpriteComponent lets call it a DisplayComponent instead and implement it as follows: class DisplayComponent implements Component { Sprite display; } The context of the component is now ...


1

Everytime you move the sprite, move the camera too. This sounds like it's essentially what you're doing now. If you're encountering performance issues, then you should profile your code to determine where your slow code is. If you're not seeing performance issues, then you don't need to worry about performance issues. Doing a few calculations every frame to ...


0

Layers are usually used for 3D animations that share common avatar and masking them. You said they are sprite animations. In case of sprite animation, ax/prop animation is done with main animation sprites or separate object animation with separate animator. If ax's animation is a sprite animation then you have to create an extra state of animation that has ...


1

Rather than loading and unloading the textures on a per-frame basis, one possibility would be to load all the frames for a certain animation at once. For example, if you're about to play the attack animation, load all the frames for the attack animation(s) into memory if they aren't already there (checking whether the animation already exists in memory would ...


2

I think you can't do it. Phaser groups doesn't have body: http://phaser.io/docs/2.4.4/Phaser.Group But you can use setAll method to set properties to all sprites of a group: http://phaser.io/docs/2.4.4/Phaser.Group.html#setAll Otherwise, if you want more complex objects you could try another type of physics (P2) and make complex bodies with polygons.


0

So I finally get it to work using the built-in "Sprite/Default" Unity shader with the addition of Fallback "Legacy Shaders/Transparent/Cutout/VertexLit" at the end.


1

Use cast shadows as "Two Sided". You should use a quad with Standard Shader in Cutout and a duplicated and flipped quad for opposite side. They will have mesh rendered in them and auto shadow cast selected. You can turn off Shadow cast for one. That way you are not bound to sprite. You can take advantage of Standard Shader in that case.


0

You can assign a listener to each of these cards if they are actors. You can create and enum with each card: public enum Cards{ ACE_HEART("ACE_HEART.png"), 2_HEART("2_HEART.png"), 3_HEART("3_HEART.png"); //etc private final String name; Cards(String name) { this.name = name; } public int getValue() { return name; } } and ...


4

Top right of the inspector right next to the little lock icon -> select normal. You should now see the sorting layers and order.


0

I have a similar problem with jerky frames using android GL 2.0. When traced on android studio GL profiler I saw that the glcompileshader function is called multiple times during game play. This is an expensive call but accounts for the jerkiness. What causes these multiple calls to glcompilershader? I can only guess happens because the shader is invalid ...



Top 50 recent answers are included