Skip to content

Commit

Permalink
Export plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
rexrainbow committed Jan 30, 2025
1 parent 6303a82 commit fced715
Show file tree
Hide file tree
Showing 42 changed files with 1,098 additions and 692 deletions.
53 changes: 38 additions & 15 deletions dist/rexcolorcomponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -30089,7 +30089,7 @@
const GetValue$i = Phaser.Utils.Objects.GetValue;
const IsPlainObject$2 = Phaser.Utils.Objects.IsPlainObject;
const Clamp$3 = Phaser.Math.Clamp;
const SnapTo$1 = Phaser.Math.Snap.To;
const SnapTo$2 = Phaser.Math.Snap.To;

class Slider extends ProgressBase(Sizer) {
constructor(scene, config) {
Expand Down Expand Up @@ -30210,7 +30210,7 @@
// Override
set value(value) {
if (this.gap !== undefined) {
value = SnapTo$1(value, this.gap);
value = SnapTo$2(value, this.gap);
}
var oldValue = this._value;
this._value = Clamp$3(value, 0, 1);
Expand Down Expand Up @@ -30499,7 +30499,7 @@
return scrollBar;
};

const SnapTo = Phaser.Math.Snap.To;
const SnapTo$1 = Phaser.Math.Snap.To;
Phaser.Math.Clamp;

// this: Scroller
Expand Down Expand Up @@ -30542,9 +30542,7 @@
// Distance of deceleration
var dist = (speed === 0) ? 0 : (speed * speed) / (2 * this.slidingDeceleration);
end += (speed > 0) ? dist : -dist;

var value0 = this.minValue;
end = SnapTo(end - value0, snapStep) + value0;
end = SnapTo$1(end, snapStep, this.minValue);
// Distance of snapping
dist = Math.abs(end - start);

Expand Down Expand Up @@ -31510,13 +31508,26 @@
}

const GetValue$c = Phaser.Utils.Objects.GetValue;
const SnapTo = Phaser.Math.Snap.To;

var AddSlider = function (topPatent, sliderParent, axis, config) {
axis = axis.toUpperCase();
var isAxisY = (axis === 'Y');
var isScrollXYMode = (topPatent.scrollMode === 2);
var child = topPatent.childrenMap.child;

var snapStep;
var snapStepKey = `snapStep${axis}`;
if (isScrollXYMode) {
snapStep = GetValue$c(config, snapStepKey, undefined);
} else {
var snapStep = GetValue$c(config, 'snapStep', undefined);
if (snapStep === undefined) {
snapStep = GetValue$c(config, snapStepKey, undefined);
}
}
topPatent[snapStepKey] = snapStep;

var sliderConfig, slider;
var sliderConfigKey = `slider${axis}`;
if (isScrollXYMode) {
Expand All @@ -31537,8 +31548,6 @@
sliderConfig.orientation = (isAxisY) ? 1 : 0;
slider = CreateScrollbar(topPatent.scene, sliderConfig);

slider.tickLength = GetValue$c(sliderConfig, 'tickLength', undefined);

var column, row, padding;

var sliderPosition = GetValue$c(sliderConfig, 'position', 0);
Expand Down Expand Up @@ -31667,6 +31676,8 @@
scrollerConfig.rectBoundsInteractive = (scrollDetectionMode === 1);
}

scrollerConfig.snapStep = snapStep;

scroller = new Scroller(child, scrollerConfig);

if (child.isRexContainerLite) {
Expand Down Expand Up @@ -31715,7 +31726,21 @@
.on('valuechange', function (newValue) {
topPatent[keyST] = newValue;
topPatent.emit(eventName, topPatent);
})
.on('inputend', function () {
var snapStep = topPatent[`snapStep${axis}`];
if (snapStep) {
var min = topPatent[(isAxisY) ? `topChildOY` : `leftChildOX`];
var max = topPatent[(isAxisY) ? `bottomChildOY` : `rightChildOX`];
var valueEnd = topPatent[`childO${axis}`];
var valueTo = SnapTo(valueEnd, snapStep, min);
var easeDuration = 500 * (Math.abs(valueTo - valueEnd) / snapStep);
slider
.setEaseValueDuration(easeDuration)
.easeValueTo(valueTo, min, max);
}
});

}

if (scroller) {
Expand Down Expand Up @@ -31743,6 +31768,10 @@
}
mouseWheelScroller
.on('scroll', function (incValue) {
var snapStep = topPatent[snapStepKey];
if (snapStep) {
incValue = snapStep;
}
topPatent[methodAddChildOXY](-incValue, true);
});
}
Expand Down Expand Up @@ -31821,7 +31850,7 @@
config.orientation = (!isRevererXY) ? 1 : 0;
super(scene, config);
this.type = GetValue$a(config, 'type', 'rexScrollable');
this.scrollMode = scrollMode;
this.scrollMode = scrollMode;

// Add elements
// Background
Expand Down Expand Up @@ -32279,12 +32308,6 @@
child.input.dropZone = enable;
return this;
}

setSnapStep(snapStep) {
this.snapStep = snapStep;
return this;
}

}

// mixin
Expand Down
2 changes: 1 addition & 1 deletion dist/rexcolorcomponents.min.js

Large diffs are not rendered by default.

53 changes: 38 additions & 15 deletions dist/rexcolorinput.js
Original file line number Diff line number Diff line change
Expand Up @@ -33758,7 +33758,7 @@
const GetValue$h = Phaser.Utils.Objects.GetValue;
const IsPlainObject$1 = Phaser.Utils.Objects.IsPlainObject;
const Clamp$2 = Phaser.Math.Clamp;
const SnapTo$1 = Phaser.Math.Snap.To;
const SnapTo$2 = Phaser.Math.Snap.To;

class Slider extends ProgressBase(Sizer) {
constructor(scene, config) {
Expand Down Expand Up @@ -33879,7 +33879,7 @@
// Override
set value(value) {
if (this.gap !== undefined) {
value = SnapTo$1(value, this.gap);
value = SnapTo$2(value, this.gap);
}
var oldValue = this._value;
this._value = Clamp$2(value, 0, 1);
Expand Down Expand Up @@ -34168,7 +34168,7 @@
return scrollBar;
};

const SnapTo = Phaser.Math.Snap.To;
const SnapTo$1 = Phaser.Math.Snap.To;
Phaser.Math.Clamp;

// this: Scroller
Expand Down Expand Up @@ -34211,9 +34211,7 @@
// Distance of deceleration
var dist = (speed === 0) ? 0 : (speed * speed) / (2 * this.slidingDeceleration);
end += (speed > 0) ? dist : -dist;

var value0 = this.minValue;
end = SnapTo(end - value0, snapStep) + value0;
end = SnapTo$1(end, snapStep, this.minValue);
// Distance of snapping
dist = Math.abs(end - start);

Expand Down Expand Up @@ -35179,13 +35177,26 @@
}

const GetValue$b = Phaser.Utils.Objects.GetValue;
const SnapTo = Phaser.Math.Snap.To;

var AddSlider = function (topPatent, sliderParent, axis, config) {
axis = axis.toUpperCase();
var isAxisY = (axis === 'Y');
var isScrollXYMode = (topPatent.scrollMode === 2);
var child = topPatent.childrenMap.child;

var snapStep;
var snapStepKey = `snapStep${axis}`;
if (isScrollXYMode) {
snapStep = GetValue$b(config, snapStepKey, undefined);
} else {
var snapStep = GetValue$b(config, 'snapStep', undefined);
if (snapStep === undefined) {
snapStep = GetValue$b(config, snapStepKey, undefined);
}
}
topPatent[snapStepKey] = snapStep;

var sliderConfig, slider;
var sliderConfigKey = `slider${axis}`;
if (isScrollXYMode) {
Expand All @@ -35206,8 +35217,6 @@
sliderConfig.orientation = (isAxisY) ? 1 : 0;
slider = CreateScrollbar(topPatent.scene, sliderConfig);

slider.tickLength = GetValue$b(sliderConfig, 'tickLength', undefined);

var column, row, padding;

var sliderPosition = GetValue$b(sliderConfig, 'position', 0);
Expand Down Expand Up @@ -35336,6 +35345,8 @@
scrollerConfig.rectBoundsInteractive = (scrollDetectionMode === 1);
}

scrollerConfig.snapStep = snapStep;

scroller = new Scroller(child, scrollerConfig);

if (child.isRexContainerLite) {
Expand Down Expand Up @@ -35384,7 +35395,21 @@
.on('valuechange', function (newValue) {
topPatent[keyST] = newValue;
topPatent.emit(eventName, topPatent);
})
.on('inputend', function () {
var snapStep = topPatent[`snapStep${axis}`];
if (snapStep) {
var min = topPatent[(isAxisY) ? `topChildOY` : `leftChildOX`];
var max = topPatent[(isAxisY) ? `bottomChildOY` : `rightChildOX`];
var valueEnd = topPatent[`childO${axis}`];
var valueTo = SnapTo(valueEnd, snapStep, min);
var easeDuration = 500 * (Math.abs(valueTo - valueEnd) / snapStep);
slider
.setEaseValueDuration(easeDuration)
.easeValueTo(valueTo, min, max);
}
});

}

if (scroller) {
Expand Down Expand Up @@ -35412,6 +35437,10 @@
}
mouseWheelScroller
.on('scroll', function (incValue) {
var snapStep = topPatent[snapStepKey];
if (snapStep) {
incValue = snapStep;
}
topPatent[methodAddChildOXY](-incValue, true);
});
}
Expand Down Expand Up @@ -35490,7 +35519,7 @@
config.orientation = (!isRevererXY) ? 1 : 0;
super(scene, config);
this.type = GetValue$9(config, 'type', 'rexScrollable');
this.scrollMode = scrollMode;
this.scrollMode = scrollMode;

// Add elements
// Background
Expand Down Expand Up @@ -35948,12 +35977,6 @@
child.input.dropZone = enable;
return this;
}

setSnapStep(snapStep) {
this.snapStep = snapStep;
return this;
}

}

// mixin
Expand Down
2 changes: 1 addition & 1 deletion dist/rexcolorinput.min.js

Large diffs are not rendered by default.

Loading

0 comments on commit fced715

Please sign in to comment.