Using LC for Slideshow

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

doveweed
Posts: 22
Joined: Tue Feb 03, 2015 9:26 pm

Re: Using LC for Slideshow

Post by doveweed » Thu Feb 05, 2015 1:27 am

Currently buttons stay at upper left of center of screen when image enlarges full screen, and in full screen when using forward/back buttons, slides don't remain enlarged, and full screen button has to be pressed for each slide. When in full screen mode, all slides should display full screen.

doveweed
Posts: 22
Joined: Tue Feb 03, 2015 9:26 pm

Re: Using LC for Slideshow

Post by doveweed » Thu Feb 05, 2015 2:03 am

If "left" = 0 (x-coordinate of the upper-left corner of screen), and "top" = 0 (y-coordinate of the upper-left corner of screen),
what are x and y coordinates of bottom-right of screen?

And Google "LiveCode | Resolution Independence" (Should be 4th from top in search results)
Will you help figure out how to make info in article work with my SlideShow stack?

Note how "Resolution Independence" involves automatic scaling, which is just what I've been after from the start.

doveweed
Posts: 22
Joined: Tue Feb 03, 2015 9:26 pm

Re: Using LC for Slideshow

Post by doveweed » Thu Feb 05, 2015 4:51 am

Replace your Object Script for Full Screen button with this —
on mouseUp
lock screen
set the fullscreen of this stack to true
set the fullscreenmode of this stack to "letterbox"
unlock screen
end mouseUp

I've also added this to Stack Script, but I don't think it's working —
on preOpenStack
set the fullscreenmode of me to "letterbox"
end preOpenStack

Need to use points instead of pixels for images, and enough points for highest density retina displays.

Is there any way to program button differently for 1st and second mouseUp?
First mouseUp sets fullscreen mode, and second mouseUp undoes fullscreen mode.
Do you have any idea how to script that?

doveweed
Posts: 22
Joined: Tue Feb 03, 2015 9:26 pm

Re: Using LC for Slideshow

Post by doveweed » Thu Feb 05, 2015 4:54 am

Got it! Replace your Object Script for image with this —
on mouseUp
lock screen
set the fullscreen of this stack to false
unlock screen
end mouseUp

anmldr
Posts: 459
Joined: Tue Sep 11, 2012 11:13 pm

Re: Using LC for Slideshow

Post by anmldr » Thu Feb 05, 2015 6:03 am

Is there any way to program button differently for 1st and second mouseUp?
First mouseUp sets fullscreen mode, and second mouseUp undoes fullscreen mode.
Do you have any idea how to script that?
How about having 2 buttons exact same position. Make one visible and the other invisible and swap them in the mouseUp of each button. Or check the label of the button and change it each time it is pressed. Base your script on what is in the label. "Full Screen" or "Small" or whatever wording you want to use.

Linda

SparkOut
Posts: 2944
Joined: Sun Sep 23, 2007 4:58 pm

Re: Using LC for Slideshow

Post by SparkOut » Thu Feb 05, 2015 8:32 am

set the fullscreen of this stack to not the fullscreen of this stack

Will toggle (invert) the true/false state. This toggling true/false is used in lots of situations

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Using LC for Slideshow

Post by richmond62 » Thu Feb 05, 2015 8:45 am

Hi Linda,

If you download my "SCREENER" (i.e. the first demo stack) there ARE 2 buttons that toggle visible, just as you suggest.

doveweed
Posts: 22
Joined: Tue Feb 03, 2015 9:26 pm

Re: Using LC for Slideshow

Post by doveweed » Thu Feb 05, 2015 3:54 pm

When I inspect fs button object in SCREENER stack, I can see that there's also an ss button in object inspector, but I have no idea how to create a button that's invisible.
1) How do I put an invisible button on top or underneath a visible button???!
2) How do I then script onMouseup for that invisible button when there isn't an actual button to select and get Object Script?
3) What are x-y coordinates for lower right of screen if x-y coordinates for top left of screen are 0,0?
4) Is there a way to create a master control panel of buttons and then apply that to whichever card(s) I select (since buttons remain same on all card "slides") without having to cut and paste buttons onto each card?

doveweed
Posts: 22
Joined: Tue Feb 03, 2015 9:26 pm

Re: Using LC for Slideshow

Post by doveweed » Thu Feb 05, 2015 4:36 pm

How can I script button for 2 different conditions?
(Much simpler and easier than visible/invisible button just as lock screen/fullscreen is much easier than coding each image name)
For instance,
on mouseUp
lock screen
if fullscreen=false then set the fullscreen of this stack to true
set the fullscreenmode of this stack to "letterbox"
if fullscreen=true then set the fullscreen of this stack to false
unlock screen
end mouseUp
I have this working when clicking on full screen image (Object Script for image on card)
on mouseUp
lock screen
set the fullscreen of this stack to false
unlock screen
end mouseUp
And this works from FS button —
on mouseUp
lock screen
set the fullscreen of this stack to true
set the fullscreenmode of this stack to "letterbox"
unlock screen
end mouseUp
But I don't see why both can't be combined in Object Script for the one FS button.

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Using LC for Slideshow

Post by Klaus » Thu Feb 05, 2015 5:48 pm

Hi doveweed,

FULLSCREEN is not a (global) variable, but the property of a stack, so you need to do like this:

Code: Select all

on mouseUp
  lock screen
  if the fullscreen OF THIS STACK = false then 

   ## the order of these commands is also important!
   set the fullscreenmode of this stack to "letterbox"
   set the fullscreen of this stack to true

   ### use ELSE here, there are only 2 options -> TRUE/FALSE :-)
   ### if fullscreen=true then set the fullscreen of this stack to false
  else
    set the fullscreen of this stack to false
  end if
  unlock screen
end mouseUp
Best

Klaus

Klaus
Posts: 14191
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Using LC for Slideshow

Post by Klaus » Thu Feb 05, 2015 6:10 pm

Hi doveweed,
doveweed wrote:0. When I inspect fs button object in SCREENER stack, I can see that there's also an ss button in object inspector, but I have no idea how to create a button that's invisible.
Create a (visible) button and then uncheck its VISIBLE property in the inspector :D
doveweed wrote:1) How do I put an invisible button on top or underneath a visible button???!
You can drag'n'drop that button in the project browser or set its LAYER property in the inspector to a lower number than the button "on top of it".
doveweed wrote: 2) How do I then script onMouseup for that invisible button when there isn't an actual button to select and get Object Script?
Use the project browser or FIRST set its script and THEN make it invisible as in 0.
doveweed wrote:3) What are x-y coordinates for lower right of screen if x-y coordinates for top left of screen are 0,0?
x2 =
a.
the width of this stack
## or of this cd, which is identical

b.
the bottom of this stack

c.
item 1 of the bottomright of this stack

y2 =
a.
the height of this stack
## or of this cd, which is identical

b.
the right of this stack

c.
item 2 of the bottomright of this stack

Always remember that LC is VERY english like :D
doveweed wrote:4) Is there a way to create a master control panel of buttons and then apply that to whichever card(s) I select (since buttons remain same on all card "slides") without having to cut and paste buttons onto each card?
Yes, create your button(s) and other controls you need on more than one card,
select all of them and then GROUP SELECTED -> menu -> Object
Shortcut: command-g
Then name that group (always a good idea!) and check its "backgroundbehavior" in the inspector.
Now if you create a new card, this group will automatically be placed on that new card.
To add a group manually to a already made card, go to that card and use menu: Object -> Place group -> (name of your group here)

To learn more about the basics of Livecode, I recommend to check these great stacks:
http://www.hyperactivesw.com/revscriptc ... ences.html

Best

Klaus

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7390
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Using LC for Slideshow

Post by jacque » Thu Feb 05, 2015 10:09 pm

Doveweed:

I second Klaus' suggestion to go through the scripting conference stacks. It will give you the overview you need to understand the advice you get here. Most of your questions are addressed in that series, and everything will make a lot more sense once you have the basics. The stacks are arranged in order, with the first stack assuming no previous programming experience. Work your way through them in order. You may find you don't need to study more than the first five or six stacks, and then you can look at the others later when you want to work with the more advanced topics.

I think without these basic concepts of how LC works, you'll find yourself struggling harder than you need to.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

doveweed
Posts: 22
Joined: Tue Feb 03, 2015 9:26 pm

Re: Using LC for Slideshow

Post by doveweed » Fri Feb 06, 2015 4:35 am

Danke Klaus! Less is more. The Object Script works like a charm, with no need for duplicate invisible buttons. But thanks for explaining how to create and script invisibles all the same, as that may most likely come in handy someday with something else.
And thanks for the stack link too.
Jacqueline, thanks for your suggestion. I've downloaded and unzipped the Scripting Conference stacks from the link Klaus provided, and have my eye on consuming and digesting them as soon as I can.

doveweed
Posts: 22
Joined: Tue Feb 03, 2015 9:26 pm

Re: Using LC for Slideshow

Post by doveweed » Fri Feb 06, 2015 5:16 am

BTW is there a way to upload a standalone app to a server and embed app in HTML on webpage so app can be run in a browser over the internet?

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10097
Joined: Fri Feb 19, 2010 10:17 am

Re: Using LC for Slideshow

Post by richmond62 » Fri Feb 06, 2015 12:19 pm

If you are prepared to wait (not sure how long) an extension to convert Livecode stuff into HTML is in the pipeline.

Post Reply