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.

Newcomers DBPro Corner / Help with coloring Cube

Author
Message
Bigsnake
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: England
Posted: 13th Aug 2009 20:17
I currently got this as my code :



How Do I add color to the the object I have created ?

Thx

Your signature has been erased by a mod because it's taller than 600x120
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 13th Aug 2009 20:35
You can use COLOR OBJECT the same way you colored the backdrop with the RGB command.

The syntax is:

COLOR OBJECT Object Number, Color Value

Bigsnake
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: England
Posted: 13th Aug 2009 20:41
I was using that, I forgot to put the comma in, damn it

Thx for help

Your signature has been erased by a mod because it's taller than 600x120
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 14th Aug 2009 00:14
It's ok... we all make small mistakes.

BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 14th Aug 2009 01:32
Also, you don't need to put the COLOR OBJECT or the COLOR BACKGROUND in your main loop, put them before it (it's give you slightly better performance).



Bigsnake
15
Years of Service
User Offline
Joined: 7th Apr 2009
Location: England
Posted: 14th Aug 2009 18:18
Mine doesnt lagg though

Your signature has been erased by a mod because it's taller than 600x120
BMacZero
18
Years of Service
User Offline
Joined: 30th Dec 2005
Location: E:/ NA / USA
Posted: 14th Aug 2009 18:22
Sure, it's a very small difference, probably not even noticeable to us, but why introduce even that small slowdown when a simple cut/paste will easily fix it?



Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 14th Aug 2009 20:28 Edited at: 14th Aug 2009 20:29
Listen to him Bigsnake.

It's a lot of little slowdowns that add up to big slowdowns for bigger projects. If the color is going to stay the same you only need to do it once and not every time a loop happens. Having it do a color change every loop to a color that is exactly the same as the last loop is unnecessary. It may not seem like it but it loops really fast.

Try running your code with some additions of my own:


Login to post a reply

Server time is: 2024-11-25 03:03:14
Your offset time is: 2024-11-25 03:03:14