dialogic-godot / dialogic

💬 Create Dialogs, Visual Novels, RPGs, and manage Characters with Godot to create your Game!
https://dialogic.pro
MIT License
3.85k stars 221 forks source link

Character portrait position related to viewport size #469

Closed rretureau closed 1 year ago

rretureau commented 3 years ago

Is your feature request related to a problem? Please describe. Right now, the character portrait positions are hard coded in the move_to_position function in Portrait.gd. This cause trouble for lower resolution games (pixel art).

Describe the solution you'd like I implemented a quick fix but not sure this is the right way of doing it. Here is the code that would replace the first part of the move_to_position function in Portrait.gd :

func move_to_position(position_offset, time = 0.5):
    var reference = get_viewport().get_visible_rect().size
    var positions = {
        'left': Vector2(-2*(reference.x/7), 0),
        'right': Vector2(2*(reference.x/7), 0),
        'center': Vector2(0, 0),
        'center_right': Vector2(-(reference.x/7), 0),
        'center_left': Vector2(reference.x/7, 0)
        }

This solution distribute the character portraits equally along the viewport size.

coppolaemilio commented 2 years ago

In version 2 the portrait positions are fully customizable, so I'm closing this one :)

zaknafean commented 1 year ago

Reopening this for possible implementation, evaluating it

zaknafean commented 1 year ago

Swapped some negatives, and we're good to go. Fixed in #1512

coppolaemilio commented 1 year ago

Awesome! Sorry for dismissing this one 😅