Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Embossing a sprite on an image background

 
bab javier
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
tnx
 
Pavlin Mihalev
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
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.
Cheers,
Pavlin
 
Puneet Gupta
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi!!!
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Puneet:
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic