Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Question - Floorcolor switch statement

A topic by casho333 created Oct 01, 2019 Views: 449 Replies: 5
Viewing posts 1 to 5
(1 edit)

Just purchased this asset, and just have an initial question. In the Player step event the floorcolor switch statement is based on the image_blend value. I know this is a basic question, but where can I set the blend mode for an object that I added to the room. For example, if I add the objSpring object to the room, where can I assign the image_blend value of 3452415 (which is used in the switch statement for the spring). I have looked in the color menu for the instance, but I can’t find where I can add this value. I know that image_blend can be set in code, but I can't see where this is set.

Sorry for asking such a basic question, I am pretty much a novice and am using this to help me learn. Don’t worry, I won’t bombard you with questions.

Thanks.

To add this this question, how do I get the image_blend value that needs to be included in the switch statement in the player step event after I change the color of the object in the room.

Thanks again.

(2 edits)

I worked out how to get the image_blend value for one of my custom colors by using the debug log, but I am sure there must be a better way.

Update: Just discovered that with the example of the spring which has an image_blend value of 3452415, that this value is obtained by converting the Hex value (FFAD34) to a decimal value, but only if the colors are reversed (ie entered as 34ADFF in the calculator). 

I still wonder why the approach of using image_blend values in the switch statement is used.

Developer (1 edit)

Hey! It is used mostly for the sake of being lightweight. You can easily change it to another variable such as the object_index, sprite_index, or whatever you fancy. To find GML raw color values i generally use https://chrisanselmo.com/gmcolor/. If you want to change the image_blend in the room, double click an object and there should be a rectangle indicating the image_blend color. Double-click that and you can pick one that you like. Let me know if you have any more questions!

Thanks. That all makes sense. If I continue to use the image_blend variable in the switch statement and change the color of he object in the room by double clicking on the object,  than it is just a matter of using the tool you provided to get the raw color values and changing those in the switch statement. Is that correct?

Developer

Indeed, that should work just fine!