Mersad Posted September 6, 2023 Share Posted September 6, 2023 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 xLive Posted September 6, 2023 Scripting Moderators Share Posted September 6, 2023 (edited) @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: By the way, is there any particular reason for not using dgsCreateImage? Edited September 6, 2023 by xLive Link to comment
Mersad Posted September 7, 2023 Author Share Posted September 7, 2023 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: 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 xLive Posted September 7, 2023 Scripting Moderators Share Posted September 7, 2023 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.. 1 Link to comment
Scripting Moderators thisdp Posted September 8, 2023 Scripting Moderators Share Posted September 8, 2023 (edited) 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 September 8, 2023 by thisdp Link to comment
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