1. Welcome to the official Starbound Mod repository, Guest! Not sure how to install your mods? Check out the installation guide or check out the modding help thread for more guides.
    Outdated Mods have been moved to their own category! If you update your mod please let a moderator know so we can move it back to the active section.
    Dismiss Notice

PenguinToast's PenguinGUI updated to work in 1.3 2017-06-11

script canvas changed in v1.3 which broke the original library so this is a working version

  1. Mobius58
    Disclaimer:
    all rights and permissions to the library belong to PenguinToast and this file shall be taken down if PenguinToast requests it​

    This is a compatibility update to PenguinToast's PenguinGUI library found at http://penguintoast.github.io/PenguinGUI/index.html .


    The reason this update exists is because changes to the script canvas in starbound version 1.3 broke the the original library and the original library has not been updated in 3 years and gives permission to make changes and redistribute.

    Also I have no intention of adding any features that were not in the library already this is only a compatibility update for version 1.3


    If want to learn how everything works and how to set up the library in general please go to the link I posted above.

    Everything functions as it originally did with the a few exceptions first is that you now have to add CanvasObj as the first input to the following items.

    the canvas widget object can be obtained by the following line:
    CanvasObj = widget.bindCanvas("scriptCanvas")

    Functions that have been changed:
    • PtUtil.drawText
    • PtUtil.fillRect
    • PtUtil.drawLine
    • PtUtil.drawRect
    • PtUtil.drawPoly
    • PtUtil.drawImage
    • GUI.step
    Objects that have been changed:
    • Line
    • Rectangle
    • Frame
    • Button
    • Label
    • TextButton
    • TextField
    • CheckBox
    • RadioButton
    • TextRadioButton
    • Slider
    • List
    The update function also needs to have a line added that it did not need in the original version:

    before
    function update(dt)
    GUI.step(dt)
    end

    after:
    function update(dt)
    CanvasObj:clear()
    GUI.step(CanvasObj ,dt)
    end



    An Example:

    so for this example in order to create a label type object in the original you had to do the following:

    LabelObj = Label(x, y,"Label Text.", fontsize,fontcolor)

    in the updated version it is now:

    LabelObj = Label(CanvasObj ,x, y,"Label Text.", fontsize,fontcolor)​

    The second is that config file is no longer set up like it is shown on PenguinToast site.
    To fins out how the config is now set up please look at the .config file found in the unpacked resources folder at objects\generic\arcadegame.

    Please ask in the discussion if you have any question about the changes, suggestions for how to improve compatibility with 1.3, or question with the library in general and I will try to help you.
    Mod Pack Permissions:
    Anyone can use this mod in their mod compilation without the author's consent.
    Mod Assets Permissions:
    Anyone can alter/redistribute the mod's assets without the author's consent.