How to change the transition type of slider with arrow and bullet (jssor) - jssor

I changed the jssor transition types (from slide to fade) by ading the folowing code :
$SlideshowOptions: { //[Optional] Options to specify and enable slideshow or not
$Class: $JssorSlideshowRunner$, //[Required] Class to create instance of slideshow
$Transitions: _SlideshowTransitions, //[Required] An array of slideshow transitions to play slideshow
$TransitionsOrder: 1, //[Optional] The way to choose transition to play slide, 1 Sequence, 0 Random
$ShowLink: true //[Optional] Whether to bring slide link on top of the slider when slideshow is running, default value is false
},
This transition works correctly when the sliders auto play but when I navigate into slides using arrow or bullet the type of transition is slide and not fade
How can resolve it ?
-the value of _SlideshowTransitions is :
var _SlideshowTransitions = [
{$Duration:700,$Opacity:2}
];

Related

How to make an animated sprite look like it's walking forward in Flame Game?

I've got a moving sprite that animates over a loop of 4 images to make it look like it's walking in one spot. I want to make the sprite move forward by a certain amount when I click a button. I've tried looking for how this might be done, but it's just made me confused. I've found this information sheet by Flame Game that explain effects, but I don't understand how to apply it to what I've got (https://docs.flame-engine.org/1.0.0/effects.html).
This is the constructor for the class that makes the dog move:
Dog()
: super(
priority: 1,
playing: true,
scale: Vector2(1, 1),
size: Vector2.all(50),
) {
animation = SpriteAnimation.spriteList(runPictures, stepTime: 0.2);
position = Vector2(150.0, 150.0);
}
I want the dog to move 100 pixels towards the top of the screen, while it's going through the loop above, when a button is clicked. This button would send it to a class that would make it move. If someone could provide sample code or a useful tutorial, it would be very helpful.
You are on the right track, you want to add a MoveByEffect to the component.
I assume that you already have the button set up and that you have access to an instance of the Dog component from there, then you simply add the effect to the component:
final dog = Dog(...);
// Or whatever callback you have for the button
void onTap() {
dog.add(
MoveByEffect(Vector2(0, -100), EffectController(duration: 1)),
);
}
This will move the dog 100px upwards during one second.

Range Slider with ETO form

A range slider is a slider with two "knobs" and the second "knob" must always have a value > that of the first "knob".
What would be the best way to achieve a range slider in ETO forms?
looks like the Slider : Control class does not expose enough information to create a slider with double Knobs.
Perhaps one way to "fake" it is to put two slider objects side by side, where the value of the first slider becomes the min value of the second slider (this will require some resizing too)?
If we were to create a custom double slider object,
http://pages.picoe.ca/docs/api/html/T_Eto_Forms_Slider.htm
To create custom controls in Eto.Forms, you can use the Drawable class, which gives you a Paint event that you can draw the UI you need, handle mouse events, etc. Setting CanFocus to true allows it to be focused so you can handle key events. For example:
public class RangeSlider : Drawable
{
public RangeSlider()
{
CanFocus = true;
Size = new Size(200, 20);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
// draw the range slider using e.Graphics
}
}

gtkmm Gtk::Layout negative child position not setting its absolute position

The description of Gtk::Layout says
Infinite scrollable area containing child widgets and/or custom drawing
I put a Gtk::Layout inside a Gtk::ScrolledWindow, gave the Gtk::Layout a size of 400x400 and then placed a Gtk::Button at (450, 450), but the scrollbars only appeared until the scrolled window was resized to 400x400, not (450+button-width x 450+button-height). So I had to move the bottom-right corner of the layout by connecting a handler to button's signal_size_allocate() signal and manually call Gtk::Layout::set_size() function to resize it up to button's boundary. Now the scrolled window shows scrollbars to reach the button. Up to this everything was OK.
class LayoutWindowTest : public ApplicationWindow {
ScrolledWindow sw;
Layout l;
Button b;
public:
LayoutWindowTest()
: l(), b("test") {
set_title("layout test");
set_size_request(400, 400);
sw.set_hadjustment(l.get_hadjustment());
sw.set_vadjustment(l.get_vadjustment());
l.set_size(400, 400);
sw.add(l);
add(sw);
// b.get_allocation() won't work because button has not been allocated a
// size yet
b.signal_size_allocate().connect(
[this](Allocation& btn_sz) {
l.set_size(btn_sz.get_x() + btn_sz.get_width(),
btn_sz.get_y() + btn_sz.get_height());
});
l.put(b, 450, 450);
show_all_children();
}
virtual ~LayoutWindowTest() {}
};
Initial window showing scrollbars and then scrolled to bottom-right corner to show button
Now I need to do the same thing for the top-left corner, i.e. put the button out of visible boundary of scrolled window and then use the scrollbars to reach the button. I tried putting the button at (-10, -10), but unlike the previous case I can't set layout's top-left corner with code by resizing it, so can't move the layout's scrollbars. When I resize the scrolled window manually by its top-left corner the button moves towards top-left with it instead of staying there. How to remedy this situation?
Initial window with button at (-10, -10) and no scrollbars, tried resizing the window by top-left handle but button moves with it
In short, how can I scroll in both top-left and bottom-right directions infinitely?

Position a UI button on bottom left of the viewport/screen?

How do I place a UI Button (the new UI) so that it is always at the bottom-left on the screen/viewport? My idea was to do it in code like this:
void Awake () {
fireButton.transform.position = new Vector3(Screen.width - 50, Screen.height - 50, 0);
}
It is not working at all. How can I best do this?
Instead of doing it in code, click on the UIButton in the scene or hierarchy then go into the inspector and in the top left of the transform component you will see a square, click it, hold shift and alt and then click the 'Bottom Left' square to latch it to that side of the screen.

Jssor - arrow key navigation

Can I use jssor slider along with fullPage slider:
http://alvarotrigo.com/fullPage/#secondPage/1
Can I use up/down arrow keys for the navigation when drag orientation is set to vertical (2) ?
Here is an example, http://www.jssor.com/testcase/full-screen-slider-new-api.source.html
And you can call $Prev, $Next api when you detect key press of up/down.
//call $Prev while 'up' keypress event fires
jssor_slider1.$Prev();
//call $Next while 'down' keypress event fires
jssor_slider1.$Next();