ivanskodje-godotengine / godot-plugin-calendar-button

A Godot Engine plugin for 2D GUI. This is a "Calendar Button", which allows you to easily select a date for various purposes. As there is currently (v2.2.alpha) no Date objects, I have created my own Date and Calendar classes for reuse.
MIT License
49 stars 13 forks source link

Godot 3 compatibility #2

Closed jospic closed 6 years ago

jospic commented 6 years ago

Hi, unfortunately this plugin seems no longer compatible with the new Godot... Please fix it. Thanks in advance. -j

jospic commented 6 years ago

Ok, all works! I've substitute get_pos and set_pos with new: get_position and set_position. And the original setup_calendar_button() function:

func setup_calendar_button():
    # Button settings
    set_toggle_mode(true)

    # Set "Normal" Button Texture
    var image_normal = Image()
    image_normal.load(btn_img_path + "btn_32x32_03.png")
    var image_texture_normal = ImageTexture.new()
    image_texture_normal.create_from_image(image_normal)
    set_normal_texture(image_texture_normal)

    # Set "Pressed" Button Texture
    var image_pressed = Image()
    image_pressed.load(btn_img_path + "btn_32x32_04.png")
    var image_texture_pressed = ImageTexture.new()
    image_texture_pressed.create_from_image(image_pressed)
    set_pressed_texture(image_texture_pressed)

with the simplest one:

func setup_calendar_button():
    # Button settings
    set_toggle_mode(true)

    # Set "Normal" Button Texture
    texture_normal = load(btn_img_path + "btn_32x32_03.png")

    # Set "Pressed" Button Texture
    texture_pressed = load(btn_img_path + "btn_32x32_04.png")

That's all! -j