Tag Info

New answers tagged

0

I had the same problem. I've made some experiments with different types of sprites (single and maps). I've tried to add transparent border to my sprite map in Photoshop, but it didn't work. Then I separated the sprites from my sprite map. It worked for me. It seems that the problem is with sprite maps.


1

I believe that in a lot of cases it's not worth investing huge amounts of time into optimizing assets to shave off a few MB of your final game. Sure, if you need to stay below a certain size limit (eg. 100MB for Apples policy for apps to transfer over cellular-networks), then it's reasonable. A general optimization you can do is making use of some PNG ...


0

I think you could save a lot of space if you drew those circles either as vectors (if Unity doesn't have vector graphics you can probably find libraries you can use with Unity that do) or if you had one circle and made coloured and resized versions in memory when your application runs. If you pack your colourful food together on one 512x512 sheet and then ...


0

if egg.cs is attached to the egg, then writing: transform.GetComponent<SpriteRenderer> ().sprite = changedContainer; will change the egg component, so maybe use target.gameObject.transform.GetComponent<SpriteRenderer> ().sprite = changedContainer;


1

Whichever option is easier for you to work with, you are unlikely to push the hardware limits with a 2d game so you should get a good framerate with either approach. Using a Group and place components in it means you can detect mouse clicks on each element the same as any other JavaFX control. Drawing into a Canvas is more similar to how a fully fledged ...


0

When you set the origin you have to take into account the position of the card and its previous origin. card.setOrigin(event.mouseButton.x - (card.getPosition().x - card.getOrigin().x), event.mouseButton.y - (card.getPosition().y - card.getOrigin().y)); I don't really know how to explain, I will try with a drawing. Your card is the red ...


1

If you can only afford to have one set of sprites drawn (i.e. your artist time/effort is limited) then get them to do the largest resolution. It's far easier to make hi-res sprites look okay when scaled down than it is to make low-res sprites look okay when scaling up. Neither approach is better than having sets of sprites tailored for your target ...


1

Vector images are useful since they would work with any resolution, and you can even use them directly in the game, letting OpenGL/DirectX rasterize it only when they are rendered to the frame buffer. But since you specifically mentioned pixel art it doesn't sound like you would get the right look with vector graphics, in that case you want to be careful ...


8

Pixel art generally responds extremely bad to any scaling. Just a small size adjustment will make pixel art appear either blurry or distorted, depending on what scaling algorithm your engine uses. For that reason it is important to make sure that the graphics are designed in exactly the resolution in which they appear in the finished game. Here is a ...


2

Make them the size they would normally be. Don't try to make them big and scale them down later. That way there will be less time loading the images (Not that it's all that long.) Less data stored as well. Make sure that when you are scaling them up to draw them to the screen, you don't use a any sort of filter. Anotherwords... Use no mipmapping. Ie point ...


0

Depends on what look you're going for. Usually you'd design for your target platform and then scale/rework art assets for secondary platforms. Make it look nice for the largest chunk of your players, essentially.


1

I used this code to generate a simple array with consecutive values like [0,1,2,3,4,5] starting at 0 var particules = 6; var _pArray = Array.apply(null, {length: particules}).map(Number.call, Number) and then i used this array as a second param in the makeParticles method : emitter.makeParticles('logo_sheet', _pArray ); Works perfectly !


0

If you're having trouble linking the sprite in your script, why don't you just assign your script to the sprite itself? Instead of : Resources.Load<Sprite>("Assets/Images/FireMonsters/Lamor_Icon"); make a generic script, that will GetComponent<Sprite> from the sprite you assign it to, add that sprite to your hierarchy, and run your code then? Or ...


0

something like this? if (GetComponent<NameOfScript>().enabled == true)


1

It would be better to add a bool variable into your Script and then toggle it on/off. var object1Script = object1.GetComponent<MyScript>(); var object2Script = object2.GetComponent<MyScript>(); object1Script.enabled = toggle; object2Script.enabled = !toggle;


1

As far as I know, this is possible using the sf::Image class: sf::Image spritesheet; spritesheet.loadFromFile("spritesheet.png"); int currentSprite = 2; sf::Texture texture; texture.loadFromImage (spritesheet, currentSprite*spriteWidth, spriteHeight); sf::Sprite sprite; sprite.setTexture(texture); If you do this in a for-loop, you could create a fluent ...



Top 50 recent answers are included