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.

DarkBASIC Professional Discussion / A few questions about object textures and instances

Author
Message
Alaror
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 17th Aug 2011 19:34
I'm currently using "instanced" copies of objects to represent tiles in my game. These have the benefit of being a little quicker than just creating objects, but I've run into some issues.

1. For some reason the textures of instanced copies of objects are much darker than the objects themselves. Is there something I'm doing wrong in the parent object creation code?



2. Because my world is made up of blocks, the textures look very repetitive. I'd like to alleviate this by using a random texture for each block, but instead of having every variation as a separate image it'd be nice to use one which I can move around (much like animating sprites I'd imagine). I looked through the object commands but didn't find anything that did this. Did I simply overlook it?
Mugen Wizardry
User Banned
Posted: 17th Aug 2011 19:37
Get Blitz Terrains.

CHECK OUT MY WEBSITE AT http://imageposeidon.com/ !
Max P
16
Years of Service
User Offline
Joined: 23rd Jan 2010
Location:
Posted: 17th Aug 2011 19:40
Quote: "I'd like to alleviate this by using a random texture for each block, but instead of having every variation as a separate image it'd be nice to use one which I can move around "

Create an image with your texture in it as tiles, like animated sprites. Use

To scale the object texture to the right size, then use

to select the right texture. first texture is imageNR=1
Alaror
15
Years of Service
User Offline
Joined: 9th May 2011
Location:
Posted: 18th Aug 2011 18:58
@Max P

Ah that's awesome! I'll definitely give that a try soon.


Still haven't worked out what's making my instanced objects darker than their parent objects.
Bluespark
15
Years of Service
User Offline
Joined: 18th Mar 2011
Location:
Posted: 18th Aug 2011 19:54
Agreed. Nice and fast code.

Login to post a reply

Server time is: 2026-07-10 10:19:53
Your offset time is: 2026-07-10 10:19:53