File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes Embossing a sprite on an image background Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Embossing a sprite on an image background" Watch "Embossing a sprite on an image background" New topic

Embossing a sprite on an image background

bab javier
Ranch Hand

Joined: Aug 12, 2003
Posts: 32
hello again!
I positioned a sprite on an image background. Problem is whenever i scroll the background, the sprite doesn't move with it. Is there a way to fix a sprite on a certain area on the image and its movement will be with its background?
Pavlin Mihalev

Joined: Apr 29, 2003
Posts: 28
I would suggest you to create a background bufer image, get the image graphics, draw in this graphics the image you want to be fixed and then move the bufer.

------<br />
Puneet Gupta

Joined: Aug 20, 2003
Posts: 9
Need your help on that..
how to create a background picture..
i am loading the image but i am not able to resize the image's width/height as per the canvas width/height. as a result of that there is some white area left.
also as the canvas's width/height can change(depending on the screen size) i don't want to specify the image's width/height
help needed
bab javier
Ranch Hand

Joined: Aug 12, 2003
Posts: 32
thanks Pavlin. its working!
now i have another problem, those sprites that i have embossed are not interactive. they can't collide with other sprites. i think it has been converted or treated as an image.
are u making a program for a Nokia phone? if yes, u can use DirectUtils.createImage(width, height, ARGBcolor). this will make the whites transparent.
if u want ur image to fit the whole canvas, i would suggest that u make or have a graphic designer make an image that has ur canvas dimensions. i won't recommend that u resize (through code) ur image for it will be blurred. the pixels usually "explode".
hope this helps.
I agree. Here's the link:
subject: Embossing a sprite on an image background
It's not a secret anymore!