Skip to content

Instantly share code, notes, and snippets.

View JetLua's full-sized avatar
🍉
hot reload

JetLu JetLua

🍉
hot reload
View GitHub Profile
@JetLua
JetLua / phaser.pointer.js
Last active May 6, 2018 17:35
phaser 旋转画布后的点击事件映射
// game.rotation: 画布的旋转角度,可简化为landscape | portrait
Object.defineProperties(phaser.Input.Pointer.prototype, {
x: {
get() {
return config.landscape ? this.position.y / this.manager.bounds.width * this.manager.bounds.height : this.position.x
},
set(v) {
this.position.x = v
@JetLua
JetLua / gulpfile.js
Created June 15, 2017 04:14
编译`bootstrap`用的。
const
gulp = require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
sass = require('gulp-sass'),
minify = require('gulp-minify-css')
gulp.task('default', function() {
gulp.src('bootstrap.scss')
.pipe(sass())
.pipe(autoprefixer())
PIXI.interaction.InteractionManager.prototype.mapPositionToPoint = function(point, x, y) {
let rect
// IE 11 fix
if (!this.interactionDOMElement.parentElement) {
rect = {x: 0, y: 0, width: 0, height: 0}
} else {
rect = this.interactionDOMElement.getBoundingClientRect()
}
@JetLua
JetLua / orientation.js
Last active June 9, 2024 14:55
pixijs 屏幕自适应
const resize = () => {
let
w = window.innerWidth,
h = window.innerHeight,
l, t
// 横屏
if (window.innerWidth / window.innerHeight >= 1) {
view.style.transform = 'rotate(0)'
window.GAME_ROTATE = 0
if (window.innerWidth / window.innerHeight >= GAME_RATIO) {
@JetLua
JetLua / Qt.pro
Last active April 9, 2017 15:53
Qt(vs)设置
INCLUDEPATH += "D:\portable\vs\vc\include" \
"D:\portable\vs\sdk\Include\shared" \
"D:\portable\vs\sdk\Include\ucrt" \
"D:\portable\vs\sdk\Include\um" \
"D:\portable\vs\sdk\Include\winrt"
LIBS += -L"D:\portable\vs\vc\lib\amd64" \
-L"D:\portable\vs\sdk\Lib\um\x64" \
-L"D:\portable\vs\sdk\Lib\ucrt\x64"