Forum
Unreal Software Ideas For UnrealSoftware Sitehttps://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
https://stackoverflow.com/a/57795495/8979337
It was added a while ago and not many people know about it because there's no documentation for it.
It is the only (relatively useful) function that is not documented.
Of course there are many undocumented console commands, which should also be documented, but I ask of this one singular function to be documented.
I even made documentation for it so it'll be easier to add:
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Enables or disables the shadow effect for an image. **Example usage**: ``` local id = image("gfx/sprites/flare2.bmp", 0, 0, 2) imageshadow(id, 1) -- Enable shadowing for the image ``` @param imgID number: The identifier of the image to modify. @param value number: `0` to disable the shadow, `1` to enable the shadow.
EDIT:
Three new functions that I'd hope could be documented are:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- Checks if the given path exists. --- --- @param path string Path to directory. --- --- @return boolean exists Whether the path exists or not. function io.isdir(path) end --- Returns a list containing the files in a directory. --- --- @param path string Path to directory. --- --- @return function: A function that can be used to enumerate over a list of files. function io.enumdir(path) end --- Returns the amount of time that passed since the game started in milliseconds. --- --- @return number milliseconds Number of milliseconds since the game started. --- > **Attention:** The number will eventually overflow when it reaches [the highest possible integer number](lua://math.huge). --- --- @see os.time for seconds. --- @see os.difftime for time comparison. function os.millisecs() end
In continuation to this, there's also this:
1
2
3
4
2
3
4
--- This function serves no purpose as it is improperly implemented. --- --- For more information, click [here](https://www.unrealsoftware.de/forum_posts.php?post=433322&start=0#post433324). function os.info() end
edited 4×, last 16.12.24 09:18:27 pm
I haven't used it in a while but it creates a shadow for the image (similar to the one created for players).
I can't supply an example.
I revisited it, and I can elaborate on what it does.
It will turn whatever image you give it into a shadow. It won't add a shadow, it will make the image behave like a shadow.
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
-- Create car image: local car_img = image('gfx/car.png', 100, 100, 1) -- Note this is a top image. -- Create car's shadow image: local car_shadow = image('gfx/car.png', 100, 100, 0) -- Note this is a floor image. -- Make shadow black: imagecolor(car_shadow, 0, 0, 0) -- Enable shadow behaviour: imageshadow(car_shadow, 1)
Result:
The shadow supports the light engine and other various things like a real shadow, because it is a real shadow.
One more reason to document what the function does.
Also by day/light system, it's a real shadow.
Probably by player's shadow settings too (untested).
Mami Tomoe has written
@ Gaios: It isn't bugged, nobody knows how to use it.
I revisited it, and I can elaborate on what it does.
I revisited it, and I can elaborate on what it does.
Oh shit bro, awesome! But we can't adjust shadow offset so for NPC the shadow is too far.
So it was bugged in 3D maybe.
The shadow uses a fixed offset because the shadow was implemented when cars were, so it fits objects the height of cars best.
Still, a really neat feature CS2D has but, (clearly) nobody knows about it.
It's only because I'm a CS2D mole that I find these things.