Particle effects libgdx - libgdx

I have made a particle effect using the particle editor that comes with libgdx. Now, I need to provide the particle effect load method 2 arguments - One is the particle file and one is a base image of the particle.
My question is - where can I find the image for the particle, the second argument?

That should be the image(s) you used in the particle editor to create the particle effect.
You'll want to place them on your project assets folder. For example in assets/particles:
particleEffect.load(Gdx.files.internal("particles/particleEffect.p"), Gdx.files.internal("particles"))

The first image is the .p image that you generated by particle editor and the second image is the actual image that we can use for the effect, say, sample image of a water drop. You should copy that image into your Asset folder and you should set the path of the second image in your .p file.
Copy an image to the asset folder.
Double click on .p file.
Search for .png file.
Set the path for the image that you saved in the asset, e.g. Drop.png.

Related

Force certain sprites into only one image of the TextureAtlas in LIBGDX

I'm using TexturePacker to make a texture atlas. The result are 2 PNGs. I need certain images(sprites) to be deposited into only one of the pngs so I only have to bind only one texture to use in some shaders that I'm using. How can I force certain sprites to pack themselves at the same place and not dispersed randomly into the 2 PNGs?
Perhaps I've misunderstood your question, but you could just use texture packer twice, once with each set of sprites. Then you know which sprites will be in which png
You can create subdirectories within the directory of your source images and sort them into pages by placing them in different subdirectories. Each subdirectory will get its own unique Texture(s). The advantage of this method is that you have only one TextureAtlas to manage. The correct Texture will be automatically grabbed when you create sprites or get TextureRegions.
If you set flattenPaths to true, then you won't have to worry about what you name the subdirectories. If you leave it as the default false, then you must include the subdirectory name as part of the sprite name with a /.

image in clojure

I made a frame give a title to it and I added buttons to the frame using clojure. I am not able to guess how to add background image to my frame.
I have a background image stored in the drive, I tried adding the background image in doto panel but it showed series of errors.
Help!
You need to go a little bit more deep than that. paintComponent of JPanel is your entry point. Inside paintComponent you can load the image in draw it.
After that, you call getContentPane().add(new YourJPanel()) of your JFrame.
One a side note. If you are planning to do Swing development in Clojure, did you consider: Seesaw?

How can I use a sprite to specify the pushpin png I want to use in a map?

After (probably) deciding on the jQuery map plugin to use (see What jQuery map plugin allows specifying the color of the pushpins?), I now need png files of colored pushpins.
I found a dandy one here: http://www.fuzzimo.com/free-vector-post-it-notes-push-pins/ :
...but it appears to be, not a collection of various png files I can use (blue.png, red.png, chartreuse.png, etc.) but one humongous .png file with an array of images. So I'm guessing this is meant to be used as a sprite. Being a sprite newby, though, I don't know how to use this image and specify the section of it that I want to use.
Specifically, the jQuery code I'll be using to set the marker's icon is like:
icon: '../img/apartment.png'
...how can I specify usage of a specific pushpin?

AS3 - Using sprite sheets to optimize my games

So, I'm trying to make my flash "games" run more smoothly. I am using individual PNG files for each of my objects in order to create player animations.
I've heard from some places that using individual files like that is bad.
I heard about using sprite sheets in order to compress data and reduce memory usage.
Maybe I have it wrong, but is there a way to merge all of my PNG images (with transparency) together in such a way that flash can continue to use the images individually?
I am really looking for ways to make my programs run more smoothly in order to be able to have lots of images on screen without much lag. Any ideas on how I can make things run better?
Here is an example of a tile based game I'm trying to make that is having serious lag issues.
TexturePacker allows merge png files. It generates two files: png and config file. Png is just merged images and config file is txt file which you can load into your swf, parse and demerge your images using it. Config could be in various formats for different game engines.
Using Photoshop or similar software you would combine all of the animations frames into one file. The size and shape of the file can be whatever you want, but each of the 'frames' should be the same size, in the same order and with no space between them. For example, lets say each frame is 25x25px, your walk animation is 10 frames and you want the final .png to be one long strip. You would make a new .png with the dimensions of either 250X25 or 25X250 and then insert all of your frames into that one file in the order of the animation. It's up to you if you want to embed these as display object or files that get loaded, but once you have them you just need to use BitmapData to break up the input file into new BitmapData objects and then display them as needed. Going one step further, lets say that most if not all characters have a walk animation and an action animation, you would make a single class to deal with loading character animations and the first row of the image file would be the walk animation and the second would be the action animation.

comparing image in cocos2d-x

I'm making a game with cocos2d-x HTML5.
On one layer there are two images which is almost same but have several different area and when I click one of them, if the clicked area of two images has a different pixel, I want to add a sticker to the same location to both images.
I want to ask that how can i compare the image pixel on cocos2d-x HTML5?
and how do I make the click event to place the sticker?
Probably CCImage class will help you.
What I suggest is, as you already have 2 images, and you have know the different area,
you can create a plist Dictionary recording the area position and size.
In your game scene, you can add transparent touchable Sprite created from your config list file, and set a color to it when it is touched.