• Dear Cerberus X User!

    As we prepare to transition the forum ownership from Mike to Phil (TripleHead GmbH), we need your explicit consent to transfer your user data in accordance with our amended Terms and Rules in order to be compliant with data protection laws.

    Important: If you accept the amended Terms and Rules, you agree to the transfer of your user data to the future forum owner!

    Please read the new Terms and Rules below, check the box to agree, and click "Accept" to continue enjoying your Cerberus X Forum experience. The deadline for consent is April 5, 2024.

    Do not accept the amended Terms and Rules if you do not wish your personal data to be transferred to the future forum owner!

    Accepting ensures:

    - Continued access to your account with a short break for the actual transfer.

    - Retention of your data under the same terms.

    Without consent:

    - You don't have further access to your forum user account.

    - Your account and personal data will be deleted after April 5, 2024.

    - Public posts remain, but usernames indicating real identity will be anonymized. If you disagree with a fictitious name you have the option to contact us so we can find a name that is acceptable to you.

    We hope to keep you in our community and see you on the forum soon!

    All the best

    Your Cerberus X Team

Fixed Mojo1 DrawImage9P frame not used

Rich

Well-known member
CX Code Contributor
3rd Party Module Dev
Tutorial Author
3rd Party Tool Dev
Joined
Sep 9, 2017
Messages
451
Hi
I found that frame wasnt used in DrawImage9P in mojo1
I have a fix for this, or you can fix it by adding frame onto each call to DrawImageRect and DrawImageRect2 in that function
I can pull and fix if needs be
 
It isn't a bug. That command has no frame parameter. But yes, it make sense to have it.
 
It isn't a bug. That command has no frame parameter. But yes, it make sense to have it.
It does in the docs and in the function parameters (and also some redundant code in the function)
 
Can you show me where you see it in the docs and function parameters? I just checked the online docs and github and can't see it.
I see a frame reference in the mojo implementation.
 
I have the fix(s) if you want them
 
fixed and tested...
645

Cerberus:
Function DrawImage9P( image:Image, x#,y#,patchSize, rotation#, scaleX#,scaleY#,frame=0 )

#If CONFIG="debug"
    DebugRenderDevice
    If frame<0 Or frame>=image.frames.Length Error "Invalid image frame"
#End

    Local patchS2 = patchSize * 2.0
    Local tsX# = ((image.width*scaleX)-patchS2) / ((image.width-patchS2))
    Local tsY# = ((image.height*scaleY)-patchS2) / ((image.height-patchS2))

    Local xo2:Float = (+image.HandleX-image.HandleX*scaleX)
    Local yo2:Float = (+image.HandleY-image.HandleY*scaleY)

    PushMatrix
    Translate x, y
    Rotate rotation
    Translate xo2, yo2

    DrawImageRect ( image,0,0, 0,0,patchSize,patchSize,frame )
    _DrawImageRect2( image,patchSize-image.HandleX,-image.HandleY,patchSize,0,image.Width-patchS2,patchSize,0.0,tsX,1.0,frame )
    DrawImageRect ( image,(image.Width*scaleX)-patchSize,0,image.Width-patchSize,0,patchSize,patchSize,frame )

    DrawImageRect( image,0,patchSize, 0,patchSize,patchSize,image.Height-patchS2,0.0, 1.0,tsY,frame )
    _DrawImageRect2( image,patchSize-image.HandleX,patchSize-image.HandleY,patchSize,patchSize,image.Width()-patchS2,image.Height()-patchS2,0,tsX, tsY, frame )
    DrawImageRect( image,(image.Width*scaleX)-patchSize,patchSize, image.Width-patchSize,patchSize,patchSize,image.Height-patchS2,0.0, 1.0,tsY,frame )

    DrawImageRect ( image,0, image.Height*scaleY-patchSize, 0,image.Height-patchSize,patchSize,patchSize, frame )
    _DrawImageRect2( image,patchSize-image.HandleX, image.Height*scaleY-patchSize-image.HandleY, patchSize ,image.Height-patchSize,image.Width-patchS2,patchSize,0,tsX,1.0, frame )
    DrawImageRect ( image,(image.Width*scaleX)-patchSize, image.Height*scaleY-patchSize, image.Width-patchSize,image.Height-patchSize, patchSize,patchSize, frame )

    PopMatrix
End
 
Back
Top Bottom