JSSOR How Copy&Paste a complete layer from one slide to the next - jssor

I have a Text+Html layer on the 1st slide that has a complicated set of transitions.
I need these same transitions on each slide - with just the text changed.
Can I Copy&Paste it somehow from slide to slide, to save re-creating it (with the psssibility or error)
Thanks
PS - VERY impressed with JSSOR

With copy/paste, it will create new layer from old one, just like making a new layer all by yourself.
You can copy one or more layers, and paste it into any other slide.
Also, you can export one or more layers, and import it at anywhere. Thus you can import layers from another slider.

Related

Image animation problems in Unity

I state that I am not very experienced in Unity.
I am working on a project in which I have some pictures. To these images I have added an animation that modifies the viewing scale (x,y,z), in such a way as to obtain a pulsation effect. ("ImageEffectPingPong")
To these same images, however, I added another animation that when the image is clicked, a fade effect is obtained, in such a way as to make the image disappear.("fadeOut_x")
When I go to make transition one of the two animations to the animator, it works as it should. the problem is when I try to merge them.
The ImageEffectPingPong animation is set in loop, while the other is activated by setting a bool to the onclick event.
animator.SetBool($"img_{pos}",true);
This is my animator
I tried a combination like this, but when I hit the first image, the fade works, but I no longer get the "pingpong" effect I want.
So how do i get the pingpong effect and when i click on an image, the fade effect, without losing the pingpong effect on the other images?
PS: to create the first effect I created a single animation that changes the scale of each image at the same time, while for the fade effect, each image has its own animation. Images can disappear following the correct sequence.
Sorry for my bad English, I hope I have explained myself as well as possible, I remain available for any misunderstandings. thank you
in case anyone has the same problem as me, I was able to solve it by adding a layer. In the first layer I run the fade animation, while in the second the pingpong effect. It is important to set the weight of the layer.

flashes of previous SceneKit content

My app alternates "pages" of SceneKit content with images and text. When I advance from an image page to a new SceneKit page, the content from the previous SceneKit page is briefly displayed before being replaced by the new content. Funky.
I'm only using one SCNScene and one SCNView. When I transition to an image type page, I hide the SCNView. To reinstate a new SceneKit display I:
remove all nodes from the rootNode
load new node graphs from file
add the new node graphs to the rootNode
unhide the SCNView
Evidently the unhiding is asynchronous and I'm seeing the remnants of the earlier scene while the new one is establishing. I'm having a similar issue with AVPlayer as well.
In past apps I experienced this same issue with MPMoviePlayer and delt with it by displaying a blank view over the movie view and then hiding that on notification that the current movie had loaded. Perhaps I can deal with the AVPlayer issue in the same manner but I don't see this applying to SceneKit. Even in the case of AVPlayer I'd like a better way of dealing with the issue if possible.
edit_1: I've tried Hal's idea of swapping out SCNScenes but still get the momentary residual image. I've tried using two SCNViews and alternately swapping them out. I've also tried moving the camera past visible elements before exiting the current scene. The prepareObjects:withCompletion handler did nothing.
It appears that it's not the nodes nor the SCNScene that is persisting but a rendered image of the scene. This is also supported by witnessing this effect with movie players as mentioned above.
edit_2: I tried a mask but like all other attempts it fails. I did have "success" with using an SCNAction to move the camera offscreen plus a completion handler to effect changes only after. However, this extends the load time by about 800%! Better to have the ugly "flash".
I've got something that works but I'm skeptical. I've created a "nullCamera", one that points to an empty field of view. Before switching out my scenes I assign that camera to the SCNView. When the new scene loads the principal camera is re-assigned. But I'm nervous about this approach.
I tried this before and it didn't work. It now works because I moved the code upstream (instead of where it seems to belong). But the interveining code has nothing to do with SceneKit. It merely parses data for strings, sets color prefs and displays a title in a label. So I'm worried that it's only about timing and I may see the issue again on, say, a faster device. Maybe writing the title to a view element forces a re-display of the SCNView too? (Which I couldn't seem to effect with code.)

how to create dynamic UI that adjust itself to current screen dimensions after loading?

I have created a level editor using new UI system in Unity3D.
Using Level Editor:
I can drag the ui elements,
I am able to save them in scriptable objects
But how could i save and load them at runtime?
I mean, if i create a level with some {width x hight} resolution and if i load it on different resolution, then the whole UI positioning get distorted.
How could i anchor them correctly programmatically?
Any help would be appreciated.
There are good video tutorials about the 4.6.x UI here:
http://unity3d.com/learn/tutorials/modules/beginner/ui.
Especially for positioning the elements I recommend watching: http://unity3d.com/learn/tutorials/modules/beginner/ui/rect-transform.
I suggest you learn how to use the anchor correctly first. If you want to change the position and size of UI element in a script you can do that through the RectTransform component. It offers functions like offsetMax,offsetMin and sizeDelta for position your UI element. The functions you need to use depend on your anchor setting.
as LokiSinclair said. You just need to Adjust the Scale that the new UI provided. It is the four Arrow on the Canvas of each Object and every UI object is inheriting their scale behavior from their Parent.

css background-image cross fade

I am working on a site that is using the nivo-slider plugin. The images in the slider cross-fade fine, but I want to add a background-image repeating pattern and also have that cross fade to another image pattern. I am restricted in that I have not been able to figure out how to add these background images as html without breaking the plugin so I am using the background-image property in css to change the background but it doesn't fade, the new background will just appear. Using css transitions does not work on css background-image and it doesn't work when I use jquery .animate or jquery fades. The closest I've come is fading out and then in, but this is not the cross-fade that I want. I haven't been able to find any javascript plugins to do it either.
So basically my question is: does anyone know how to cross-fade when changing an elements css background-image property?
I suggest two layers.
Nivo Slider
Adjacent "helper" div
We're only going to create the illusion of a crossfade.
Step one:
Layer 1 (nivo slider) fades the new background in. After it's done fading it, the background is moved to Layer 2 and removed from layer 1. The user won't see the switch as it's instantaneous.
Step two:
On the next transition, fade layer 2 out while layer 1 is fading in with the new background. Once this is done, switch the background from layer 1 to layer 2, turn layer 2 to opacity 100% and remove the background from layer 1. Again, the client-side will not see the visually switch as the appearance will look the same to them.
Rinse and Repeat.

iPhone layer management - best practice

Louis - Thanks for your input. Here is what I did, and my current issues, which i don't understand.
The menus (2) are UIImageViews that respond to touch. Each is it's own class. The 'sprites' as you called them also respond to touch.
In the .m where I add the menus and sprites to the layer, I created two container layers, via this code: menuContainer = [CALayer layer].
I ordered them with the menuContainer above the spriteContainer. Now, the sprites do move below the menus - great! But in the process, the sprites stopped responding to touch (I can understand this as they are below the menuContainer layer), and the menus stopped responding to touch as well (don't get that). Continuing to confuse the situation, a layer added to the menuContainer that responds to a multitouch gesture by popping up a slider still reads the multitouch and pops up the slider, but I can't slide the slider. This has me thoroughly confounded.
Thanks.
My app is building a background layer, then building some menu layers that should always be at the top.
After this, I add many moving layers and remove many moving layers very quickly.
My problem is I want my menu layers (there are 4) to always be in front of the other layers. I have thought of building a layer hiearchy and using the insertsublayer: atindex: method, making my menus a notional index of 1000, and inserting the multitude of moving layers at a lower index, like 200. If I insert one layer at 200 and then the next at 200, does the first layer that was assigned to 200 get shifted (to 201) or does it get blown away?
I have tried inserting the layers with the insertsublayer: below:, but that does not give me the desired results.
Thanks for the help.
You can't really do that, the layer index is not a z-order, it is an array index. From the documentation:
This value must not be
greater than the count of elements in
the sublayer array.
I think you would be best served but actually making a true hierarchy of layers as opposed to trying to shove all of you active layers into one super layer. In other, but all of your menulayers into a container layer, then insert that in the root layer where you want it. Likewise, insert all your sprites into one container layer, and put that in the root layer where you want it.
Additional stuff based on your edits:
Layers are a essentially a graphical construct, they do not directly respond to events. You either need to handle that yourself by writing code to hitTest them in the view they are attached to, or you need to use UIViews instead of layers. You were probably getting away with it before because you were manipulating the layers in such a way that the view hierarchy and layer hierarchy were consistent, but it was not clear to me from your original question that you were using views and not a purely layer based setup.
Louis -
Thanks for your input. Here is what I did, and my current issues, which i don't understand.
The menus (2) are UIImageViews that respond to touch. Each is it's own class.
The 'sprites' as you called them also respond to touch.
In the .m where I add the menus and sprites to the layer, I created two container layers, via this code: menuContainer = [CALayer layer].
I ordered them with the menuContainer above the spriteContainer. Now, the sprites do move below the menus - great! But in the process, the sprites stopped responding to touch (I can understand this as they are below the menuContainer layer), and the menus stopped responding to touch as well (don't get that). Continuing to confuse the situation, a layer added to the menuContainer that responds to a multitouch gesture by popping up a slider still reads the multitouch and pops up the slider, but I can't slide the slider. This has me thoroughly confounded.
Thanks.