Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / SetRenderToImage() and PasteSprite() transparency problems

Author
Message
Jambo B
15
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 11th Feb 2015 15:43
Hello all,

I wondered if anyone could show me how to properly use RenderToImage() and DrawSprite() together.

I’m trying to build a rounded box as a sprite by pasting together images of the corners and sides, etc. if you see what I mean. The problem is, DrawSprite seems to mess up the sprite’s transparency so that there’s a line round the transparent bit.



The one on the left is the sprite which I pasted onto the render image. The one on the right is a sprite created from the render image.

Here's the code. This is the first time I've used SetRenderToImage and I don't know what I'm doing



I'm attaching the media (2 pics).

Thanks for any help,

James

Attachments

Login to view attachments
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 12th Feb 2015 14:43
Hi,

It could be a filtering issue. Try using:



on the image that is giving you the borders. Post up an example of the problem code and we'll fix it

V2 T1 (Mostly)
Uzmadesign
Jambo B
15
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 12th Feb 2015 17:41


Thanks for your reply CJB. I added the SetImageMagFilter() command, but it had no effect.

The code and media are on my original post - appreciate anyone having a look!

Cheers,

James
Paul Johnston
TGC Developer
22
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 12th Feb 2015 19:04
Use

before drawing the sprite to the render image otherwise it will pick up some of the background clear color when it is blended into the render image.
Jambo B
15
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 12th Feb 2015 19:23
Paul, that's solved it! Thanks very much!

James

Login to post a reply

Server time is: 2024-11-25 17:27:55
Your offset time is: 2024-11-25 17:27:55