• 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

Base64 support?

Wingnut

Well-known member
3rd Party Module Dev
Tutorial Author
Joined
Jan 2, 2020
Messages
1,414
Is there base-64 support in Cerberus?

I was trying to get this working. I saw that html5 has inbuilt support for loading sounds and images from the web, so I tried it with base64 but I don't know what protocol to prefix it with?
Code:
Strict

Import mojo2
Import brl.databuffer

Function Main:Int()
    New Game
    Return 0
End
   
Class Game Extends App

    Field sprite:Image
    Field canvas:Canvas

    Method OnCreate:Int()

        canvas=New Canvas
       
        'sprite =  Image.Load("data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",0,0,0)   ' A red dot

        sprite =  Image.Load("127.0.0.1/data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg==",0,0,0) 
       
        SetSwapInterval 1 ; SetUpdateRate 0
        Return 0
    End
 
    Method OnRender:Int()
        canvas.Clear
        canvas.DrawImage sprite,0,0
        canvas.Flush
         Return 0
    End
End
 
Do a search of the forums. I'm sure that something will pop up.
 
Do a search of the forums. I'm sure that something will pop up.

Do you have insight into the Cerberus internals?

The forums has a lot of code when it comes to BASE-64 encoders and decoders, but there's no information about how to go aboutactually using BASE-64 inside LoadSound and similar commands. I have to assume it can't be done easily.

I was really after this specific solution where you'd use BASE-64 as an additional way of providing data.
DATA, INTERNAL, EXTERNAL, HTTP/HTTPS, and I wanted to see if there were a chance you could add BASE-64 on top of that. Maybe someone already thought of this, but I did not see any discussion around this.

A few people assisted me last night though and pretty much everyone estimated it would be limited, so I scratched the idea.
 
I was really after this specific solution where you'd use BASE-64 as an additional way of providing data.
DATA, INTERNAL, EXTERNAL, HTTP/HTTPS, and I wanted to see if there were a chance you could add BASE-64 on top of that.
That would require changes to transcc to inject base64 into the meta data and the target template to process base64 meta data into a usable form.
 
Back
Top Bottom