Forum

> > Unreal Software > Ideas For UnrealSoftware Site
Forums overviewUnreal Software overviewLog in to reply

English Ideas For UnrealSoftware Site

2,091 replies
Page
To the start Previous 1 2104 105 Next To the start

old Re: Ideas For UnrealSoftware Site

DC
Admin Off Offline

Quote
Very good points. Syntax highlighting and also the ability to paste images would be great additions. They are on my "nice to have" list. I can't promise that I'll add these but I would like to do it some day (with syntax highlighting being massively less effort and trouble and therefore more likely).

old Re: Ideas For UnrealSoftware Site

Mami Tomoe
User Off Offline

Quote
I humbly ask of whoever responsible to document the Lua function cs2d lua cmd imageshadow.
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
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
--- 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
Those functions do not exist by default on Lua 5.1, and are custom to CS2D, and as such, should be documented.

In continuation to this, there's also this:
1
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

old Re: Ideas For UnrealSoftware Site

Gaios
Reviewer Off Offline

Quote
@user mrc: It was introduced by user SQ probably on my request, but it's not completed. It kinda shows the shadow in 3D mode but it's still bugged. This could be very nice feature if finished.

old Re: Ideas For UnrealSoftware Site

Mami Tomoe
User Off Offline

Quote
@user Gaios: It isn't bugged, nobody knows how to use it.
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
-- 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:
IMG:https://i.ibb.co/grqq3xh/xA96tZR.png


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.

old Re: Ideas For UnrealSoftware Site

mrc
User Off Offline

Quote
Oh, it needs a new image. Basically, you can approach this by replicating the image using imagealpha, imagecolor, and imageblend. But I understand it now. The difference is that it's influenced by the lighting engine.

old Re: Ideas For UnrealSoftware Site

Gaios
Reviewer Off Offline

Quote
user Mami Tomoe has written
@user Gaios: It isn't bugged, nobody knows how to use it.
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.

old Re: Ideas For UnrealSoftware Site

Mami Tomoe
User Off Offline

Quote
@user Gaios:
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.
To the start Previous 1 2104 105 Next To the start
Log in to replyUnreal Software overviewForums overview