I am trying to make a card with a background larger than the screen (with a long array of fields) and draw links between some fields. The commands "click at" and "drag from the clickloc" don't works well at the edges of the background.
Something else to do ?
Background and "click at -----drag from"
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Dear undelouest,
Create an object, larger than your card, that can serve as background, e.g. a locked field with backgroundpatters or an image object. Group the image object and give it scrollbars. Set the margins of the group to 0. Create a new field inside the group.
Now use a repeat loop inside a mouseDown handler. Change the hscroll and vscroll of the group as necessary while looping. For example:
Give it a try and come back with your first script.
Best,
Mark
Create an object, larger than your card, that can serve as background, e.g. a locked field with backgroundpatters or an image object. Group the image object and give it scrollbars. Set the margins of the group to 0. Create a new field inside the group.
Code: Select all
create fld "New Field" in grp "Big Background"
Code: Select all
if the right of the target > the width of grp "Big Background" then set the hscroll of grp "Big Background" to (the hscroll of grp "Big Background" + 2)
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
-
- Posts: 9
- Joined: Sun Oct 05, 2008 2:22 pm
background and "click at -----drag from"
Thanks for your reply
My purpose is to make a genealogical tree (descendant) ; I made one using several cards when the row of descendants is to long ; it works but is a little tricky. so I wanted to use a single card with a moving background. But my problem is that the drag script don't works well when the width of the bg exceed 4000 pixels - on my iMac with a 24 f screen.
If you want I can mail a little stack test (12 ko)
My purpose is to make a genealogical tree (descendant) ; I made one using several cards when the row of descendants is to long ; it works but is a little tricky. so I wanted to use a single card with a moving background. But my problem is that the drag script don't works well when the width of the bg exceed 4000 pixels - on my iMac with a 24 f screen.
If you want I can mail a little stack test (12 ko)
Dear undelouest,
You will have to find a different way to do this. E.g. draw the tree objects directly on the card instead of the group and use scrollbar objects to change their positions.
Best,
Mark
You will have to find a different way to do this. E.g. draw the tree objects directly on the card instead of the group and use scrollbar objects to change their positions.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode