Jump to content

Need Help with Layering DGS Elements over dxDraw


Mersad

Recommended Posts

Hello everyone! 😊

I hope you’re all doing well. I’m currently working on a panel using dxDraw and DGS. I’m using dxDraw for background images and other elements, and DGS for edit boxes and similar components.

I’ve run into a bit of a snag, though. The DGS elements are appearing behind the dxDraw element that I’m using as a background. Since these are edit boxes, they should be appearing on top of the background.

I’ve been scratching my head over this for a while now, and any help or guidance would be greatly appreciated. Thanks in advance for your time!

Best regards.

Link to comment
  • Scripting Moderators

@Mersad Your thread has been moved to the Scripting section. Please use it for scripting questions in the future.


3 hours ago, Mersad said:

The DGS elements are appearing behind the dxDraw element that I’m using as a background.

That's because your draw functions are being executed after DGS finishes its own drawing. You can either change your onClientRender event priority to high or set DGS renderPriority to low using dgsSetRenderSetting. Both will ensure that your draw functions runs before DGS render event, which should make DGS elements render above it:

addEventHandler("onClientRender", root, drawFunction, false, "high")

addEventHandler:
zmC4m8b.png

By the way, is there any particular reason for not using dgsCreateImage?

Edited by xLive
Link to comment
10 hours ago, xLive said:

@Mersad Your thread has been moved to the Scripting section. Please use it for scripting questions in the future.


That's because your draw functions are being executed after DGS finishes its own drawing. You can either change your onClientRender event priority to high or set DGS renderPriority to low using dgsSetRenderSetting. Both will ensure that your draw functions runs before DGS render event, which should make DGS elements render above it:

addEventHandler("onClientRender", root, drawFunction, false, "high")

addEventHandler:
zmC4m8b.png

By the way, is there any particular reason for not using dgsCreateImage?

Thank you so much! That solved my problem. 😊

The reason I’m not using dgsCreateImage is that I want to create smooth and fluid animations for my background images to make them more visually appealing. As far as I know, this isn’t possible using GUI or DGS elements. Is that correct?

Link to comment
  • Scripting Moderators
5 hours ago, Mersad said:

Thank you so much! That solved my problem. 😊

The reason I’m not using dgsCreateImage is that I want to create smooth and fluid animations for my background images to make them more visually appealing. As far as I know, this isn’t possible using GUI or DGS elements. Is that correct?

I don't know what fluid animations mean for images. DGS has a lot of animation functions that can be found here, and you can also create your own animations. For CEGUI, you can use a timer or onClientRender event, along with interpolateBetween, for moving, sizing animations, etc..

  • Like 1
Link to comment
  • Scripting Moderators

For animation, you can also use dgsAnimTo/dgsMoveTo/dgsSizeTo/dgsAlphaTo

With dgsAddEasingFunction, you can even custom your animation function

If these still can not satisfy you, maybe using dgsCreateCustomRenderer with dgs image to create your dgs plugin, which can make your dxDraws can interact with dgs layer.

 

Edited by thisdp
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...