[Help] - Skywyre Edition v10 - Shadow

Hi friends, I have a question, how to activate the shadows of npc and player ?.

The engine has to put it, but I do not know which part of the code can activate it.

alt text

Thank you for those who can help me.

DrawShadow

@solidlink said in [Help] - Skywyre Edition v10 - Shadow:

DrawShadow

I do not get it, it tells me it does not exist
‘’ Search text is not found ‘’

did you click on “Search entire project”?

@solidlink Yes, is correct.

Try DrawPlayer

@solidlink said in [Help] - Skywyre Edition v10 - Shadow:

Try DrawPlayer

neither

Search for:

’ render player shadow

There’s one for players and one for NPCs

@xlithan Thank you very much, they were with you and I changed the coordinates.

’ render player shadow
If hasShadow(Sprite) Then RenderTexture Tex_Shadow, ConvertMapX(X), ConvertMapY(Y + 18), 0, 0, 32, 32, 32, 32, D3DColorRGBA(255, 255, 255, 150)
RenderTexture Tex_Shadow, ConvertMapX(X), ConvertMapY(Y + 18), 0, 0, 32, 32, 32, 32, D3DColorRGBA(255, 255, 255, 150)

’ render player shadow
If hasShadow(Sprite) Then RenderTexture Tex_Shadow, ConvertMapX(X), ConvertMapY(Y + 18), 0, 0, 32, 32, 32, 32, D3DColorRGBA(255, 255, 255, 150)
RenderTexture Tex_Shadow, ConvertMapX(X), ConvertMapY(Y + 18), 0, 0, 32, 32, 32, 32, D3DColorRGBA(255, 255, 255, 200).

But for large npc sprites it does not work.alt text

Even though I’m not familiar with this particular engine, but I believe there’s a way you can take in the width of the image and use that to center the shadow no matter the size.

@angelr said in [Help] - Skywyre Edition v10 - Shadow:

RenderTexture Tex_Shadow, ConvertMapX(X), ConvertMapY(Y + 18), 0, 0, 32, 32, 32, 32, D3DColorRGBA(255, 255, 255, 150)

One way to draw shadow everytime is to remove the

'If hasShadow(Sprite) Then

Other way is to scale shadow image by sprite image. I made a quick code that should work.
It is based on Sprites width (Because shadow is 32x32 + adding height to calculation would over complicate things)
This simply draws shadow based on sprites width. If its bigger than the shadow width then the shadow gets resized to the size of Sprites width x Sprites width. This way quality loss will be minimal. Anyway here is the code:

Dim shadowTempX as long

If VXFRAME = False Then
 shadowTempX = Tex_Character(Sprite).Width / 4
Else
  shadowTempX = Tex_Character(Sprite).Width / 3
End If

If shadowTempX > Tex_Shadow.Width Then
RenderTexture Tex_Shadow, ConvertMapX(X), ConvertMapY(Y + 18), 0, 0, shadowTempX, shadowTempX, shadowTempX,shadowTempX, D3DColorRGBA(255, 255, 255, 150)
else
RenderTexture Tex_Shadow, ConvertMapX(X), ConvertMapY(Y + 18), 0, 0, 32, 32, 32, 32, D3DColorRGBA(255, 255, 255,150)
End IF

Hope this helps 🙂

@coyote I find it perfect, so I’ll try it.

Many thanks.
When I try, I will notify you of the results.

Log in to reply