Unable to move character sprite further to the left [SOLVED]

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

Unable to move character sprite further to the left [SOLVED]

#1 Post by sasquatchii »

Hello! I am working on the UI for my game and am having trouble moving my character sprite to the left (I want to move her a few pixels).

On the left is what I hope to achieve, and on the right is the game in its current state:

Image

Here is the code for the sprite that I have for screen say/the side image:

Code: Select all

screen say(who, what):
    style_prefix "say"

    window:
        id "window"

        if who is not None:

            window:
                style "namebox"
                text who id "who"

        text what id "what"


    ## If there's a side image, display it above the text. Do not display on the
    ## phone variant - there's no room.
    if not renpy.variant("small"):
        add SideImage() xalign 0.0 yalign 1.0
        


style window is default
style say_label is default
style say_dialogue is default
style say_thought is say_dialogue

style namebox is default
style namebox_label is say_label


style window:
    xalign 0.5
    xfill True
    yalign gui.textbox_yalign
    ysize gui.textbox_height

    background Image("textbox2.png", xalign=0.5, yalign=1.0)

style namebox:
    xpos gui.name_xpos
    xanchor gui.name_xalign
    xsize gui.namebox_width
    ypos gui.name_ypos
    ysize gui.namebox_height

    background Frame("namebox2.png", gui.namebox_borders, tile=gui.namebox_tile, xalign=gui.name_xalign)
    padding gui.namebox_borders.padding
    
style say_label:
    properties gui.text_properties("name", accent=True)
    xalign gui.name_xalign
    yalign 0.57

style say_dialogue:
    properties gui.text_properties("dialogue")

    xpos gui.dialogue_xpos
    xsize gui.dialogue_width
    ypos gui.dialogue_ypos
I'm totally stumped why I can't move my character sprite over to the left a few pixels. The png image i have is completely cropped, and I checked for extra padding or margins in the code but I couldn't find anything. Does anyone have any ideas or suggestions as to how I could move her over to the left a few more pixels?

Any thoughts, ideas, or insights would be much appreciated.
Last edited by sasquatchii on Thu Aug 17, 2017 9:24 pm, edited 1 time in total.
ImageImage

User avatar
sasquatchii
Miko-Class Veteran
Posts: 552
Joined: Fri Jul 04, 2014 7:48 am
Completed: A Day in the Life of a Slice of Bread
Deviantart: sasquatchix
Soundcloud: sasquatchii
itch: sasquatchii
Location: South Carolina
Contact:

Re: Unable to move character sprite further to the left

#2 Post by sasquatchii »

I figured it out!! Instead of xalign and yalign for defining where the side image is, I used xpos and ypos and can now move the side image to wherever I want :)
ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users