我目前正在开发使用Phonegap和HTML5的iPhone应用程序.我使用localstorage来保存游戏中的成就.
我想知道用户从AppStore中获取该应用程序的更新会发生什么.localstorage数据是否持久存在?或者我必须切换到实际上被W3C放弃的SQLite.
任何经验将不胜感激.
我开始尝试使用kha on haxe,并为我年迈的iPad2编译了一个示例项目.
现在我想知道如何在屏幕上显示实际帧率.
作为起点,我找到了这个回购:
https://github.com/lewislepton/kha-tutorial-series/blob/master/007_fontText
它加载字体并在屏幕上显示一些文本.它还将帧速率设置为60fps.
所以现在我只需要调用fps并通过drawString显示它.
但是如何计算呢?
编辑:
感谢@RobDangerous,这似乎有效:
package;
import kha.Framebuffer;
import kha.Color;
import kha.Assets;
import kha.input.Surface;
import kha.Font;
import kha.Scheduler;
import Std;
class Project {
public var font:Font;
public var previousRealTime:Float;
public var realTime:Float;
public function new() {
font = Assets.fonts.OpenSans;
previousRealTime = 0.0;
realTime = 0.0;
Surface.get().notify(onTouchDown, onTouchUp, onTouchMove);
}
public function update():Void {
previousRealTime = realTime;
realTime = Scheduler.realTime();
}
public function render(framebuffer:Framebuffer):Void {
var graphics = framebuffer.g2;
graphics.begin();
var fps = 1.0 / …Run Code Online (Sandbox Code Playgroud) 我有以下测试代码
const sth = {
one: 'one',
two: 'two',
three: {
foo: 'foo',
bar: 'bar',
}
};
const state = {
...sth
};
Run Code Online (Sandbox Code Playgroud)
当我运行 jshint 时,我得到以下输出
jshint --config .jshintrc test.js
test.js: line 12, col 3, Expected '}' to match '{' from line 11 and instead saw '...'.
test.js: line 12, col 6, Missing semicolon.
test.js: line 12, col 9, Missing semicolon.
test.js: line 12, col 6, Unrecoverable syntax error. (92% scanned).
4 errors
Run Code Online (Sandbox Code Playgroud)
但这是完全有效的 es6 代码。
我的 .jshintrc 如下所示:
{ …Run Code Online (Sandbox Code Playgroud)