AngelR Posted October 1, 2017 Author Share Posted October 1, 2017 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](https://i.imgur.com/y92GE66.png)Thank you for those who can help me. Link to comment Share on other sites More sharing options...
SolidLink Posted October 1, 2017 Share Posted October 1, 2017 DrawShadow Link to comment Share on other sites More sharing options...
AngelR Posted October 1, 2017 Author Share Posted October 1, 2017 @solidlink said in [\[Help\] \- Skywyre Edition v10 \- Shadow](/post/700346):> DrawShadowI do not get it, it tells me it does not exist'' Search text is not found '' Link to comment Share on other sites More sharing options...
SolidLink Posted October 1, 2017 Share Posted October 1, 2017 did you click on "Search entire project"? Link to comment Share on other sites More sharing options...
AngelR Posted October 1, 2017 Author Share Posted October 1, 2017 @solidlink Yes, is correct. Link to comment Share on other sites More sharing options...
SolidLink Posted October 1, 2017 Share Posted October 1, 2017 Try DrawPlayer Link to comment Share on other sites More sharing options...
AngelR Posted October 1, 2017 Author Share Posted October 1, 2017 @solidlink said in [\[Help\] \- Skywyre Edition v10 \- Shadow](/post/700350):> Try DrawPlayerneither Link to comment Share on other sites More sharing options...
Xlithan Posted October 1, 2017 Share Posted October 1, 2017 Search for:' render player shadowThere's one for players and one for NPCs Link to comment Share on other sites More sharing options...
AngelR Posted October 1, 2017 Author Share Posted October 1, 2017 @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](https://i.imgur.com/SrLyohH.png) Link to comment Share on other sites More sharing options...
Sunku Posted October 1, 2017 Share Posted October 1, 2017 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. Link to comment Share on other sites More sharing options...
Coyote Posted October 1, 2017 Share Posted October 1, 2017 @angelr said in [\[Help\] \- Skywyre Edition v10 \- Shadow](/post/700353):> 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) ThenOther 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 IFHope this helps :) Link to comment Share on other sites More sharing options...
AngelR Posted October 3, 2017 Author Share Posted October 3, 2017 @coyote I find it perfect, so I'll try it.Many thanks.When I try, I will notify you of the results. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now