Combine Displayables for Drag

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
l1997
Newbie
Posts: 15
Joined: Thu Dec 28, 2017 10:42 am
Contact:

Combine Displayables for Drag

#1 Post by l1997 »

I want an Image and a Text displayable to be combined and act as a drag item. The combination should be both overlapping.
So, I made a function like this with HBox:

Code: Select all

def makedropitem(txt):
        x = HBox("frame.jpg",txt)
        return x
where txt is the text displayable. I call this from my drag group as:

Code: Select all

BigPuzzle.add(Drag(d=makedropitem(Text(">>XYZ, style="optioncolor")),drag_name=....)
This works completely fine and gives the perfect result as I want but the displayables appear side by side. I want them to overlap. I couldnt find any other layout grid class either.
What I am getting:https://ibb.co/jYdCaH
What I want: https://ibb.co/e8nzNx

User avatar
trooper6
Lemma-Class Veteran
Posts: 3712
Joined: Sat Jul 09, 2011 10:33 pm
Projects: A Close Shave
Location: Medford, MA
Contact:

Re: Combine Displayables for Drag

#2 Post by trooper6 »

The objects are side by side because you are putting them in an HBox...which places everything side by side horizontally. (A VBox puts things side by side vertically). Try a fixed?
A Close Shave:
*Last Thing Done (Aug 17): Finished coding emotions and camera for 4/10 main labels.
*Currently Doing: Coding of emotions and camera for the labels--On 5/10
*First Next thing to do: Code in all CG and special animation stuff
*Next Next thing to do: Set up film animation
*Other Thing to Do: Do SFX and Score (maybe think about eye blinks?)
Check out My Clock Cookbook Recipe: http://lemmasoft.renai.us/forums/viewto ... 51&t=21978

l1997
Newbie
Posts: 15
Joined: Thu Dec 28, 2017 10:42 am
Contact:

Re: Combine Displayables for Drag

#3 Post by l1997 »

Tried a "Fixed". Doesnt work with Drag because it always resets the position to the fixed parameter.

Post Reply

Who is online

Users browsing this forum: Bing [Bot], henne