How to assign a size to the PC display?


(Pierre) #1

Hello,

I created my animation on a scene of 1200X1200. This size should be used for PC display.

If I set 3 screen sizes (Iphone + ipad H + ipad V), it is the ipad H size that is displayed on PC

How to assign the size 1200X200 to the PC display?

Regards


(Hans-Gerd Claßen) #2

if you want to assign layouts beyond the rules of breakpoints … Hype offers a event called layoutrequest. So when a layout is requested you can step in and check for your specified rules and serve the layout you like too …

do a forum search for layoutRequest. there are several threads …


(Pierre) #3

Ok thanks, This is this code?

<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/mobile-detect/1.3.5/mobile-detect.min.js"></script>
	
<script>
function layoutRequest(hypeDocument, element, event) {

var md = new MobileDetect(window.navigator.userAgent);
if (!md.mobile()){
var currSceneName = hypeDocument.currentSceneName(),
biggestSceneLayout = hypeDocument.layoutsForSceneNamed(currSceneName)[hypeDocument.layoutsForSceneNamed(currSceneName).length -1],
layoutName = biggestSceneLayout.name;
return layoutName
}else{
return false
}

  }

  if("HYPE_eventListeners" in window === false) {
window.HYPE_eventListeners = Array();
  }
  window.HYPE_eventListeners.push({"type":"HypeLayoutRequest", "callback":layoutRequest});
</script>

But I do not understand why this essential and basic need is not built into Hype settings.

And with this new problem, the responsive function becomes globally very complicated:

  1. if you make a correction on the main screen (PC size), you must repeat it on all the breakpoints, it is not reflected automatically
  2. If I paste an animation on a new screen size, it does not work.

Thanks !


(Hans-Gerd Claßen) #4

to be honest: you seem to mix up questions and your first question isn’t really clear yet (at least to me :slight_smile: )

tipp: providing a simple sampledocuments that shows the problem is good practise :slight_smile:


(Jonathan Deutsch) #5

Hype’s built-in behavior to change layouts is doing so based on a breakpoint width. Each Layout can have a different width assigned to it. This is in the Scene/Layout Inspector.

You may simply need to change this to 1200 on your layout?

Note that the Layouts pane shows underneath the names the sizes in which the layout will be used.

If you do not want to use Hype’s own algorithm based on width, then the HypeLayoutRequest javascript code is available for you to construct your own layout switching algorithm.

The nature of Layouts is that they may be wildly different from each other and have quite different content. To this end they are effectively entirely different Scenes.

If you need contact to be linked together so a change in one layout affects other layouts, then you can place content in a Symbol.

Of course, I do agree the process of synchronizing across layouts could be easier and this is an area we’d like to improve.

It’d be useful to know more about what you’re doing or how you are pasting to know what isn’t working? Note that if you want animations to show up with an element, you must choose Edit > Pate with Animations.


(Pierre) #6

Thanks !!!

For screen size and “Breakpoint width” option, it’s ok

If I copy-paste an animation from my main screen size to another size (ex: iPhone), all the elements are pasted but the timelines are empty

If I paste the same files into a new scene, it works perfectly. The timelines are ok

The pb therefore comes only from the copy-pasted from one size to another


#7

You can select Edit > Paste with Animations to include those animations with your paste. You can also copy and paste the blue animation bars that represent your keyframes.


(Pierre) #8

I tested: grouped or unbundled but it does not work, the timelines are empty
Thanks!
59|437x190


(Pierre) #9

Screenshot 59


#10

Can you share your Hype document? I haven’t heard of ‘paste with animations’ not working like this. (If you’d prefer to keep it private, you can send me a private message or email support@tumult.com).


(Pierre) #11

Yes, I prefer that my file remains private and I sent it to you by email.
thank you for your understanding
Thanks !!