本文整理匯總了Java中com.jme3.system.AppSettings.setFrameRate方法的典型用法代碼示例。如果您正苦於以下問題:Java AppSettings.setFrameRate方法的具體用法?Java AppSettings.setFrameRate怎麽用?Java AppSettings.setFrameRate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jme3.system.AppSettings
的用法示例。
在下文中一共展示了AppSettings.setFrameRate方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: Viewer
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public Viewer() throws Exception{
setShowSettings(false);
AppSettings settings=new AppSettings(true);
settings.setResizable(true);
settings.setFrameRate(15);
settings.setWidth(640);
settings.setHeight(480);
settings.setTitle("Image Viewer");
reloadImage(null);
int w=IMAGE.getImage().getWidth();
int h=IMAGE.getImage().getHeight();
GraphicsDevice gd=GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
if(w<gd.getDisplayMode().getWidth()/2&&h<gd.getDisplayMode().getHeight()){
settings.setWidth(w);
settings.setHeight(h);
}
setSettings(settings);
}
示例2: createCanvas
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public Canvas createCanvas() {
String appClass = TestEditor.class.getName();
AppSettings settings = new AppSettings(true);
settings.setWidth(640);
settings.setHeight(480);
settings.setFrameRate(30);
try {
Class<? extends LegacyApplication> clazz = (Class<? extends LegacyApplication>) Class.forName(appClass);
app = clazz.newInstance();
app.setPauseOnLostFocus(false);
app.setSettings(settings);
app.createCanvas();
app.startCanvas();
JmeCanvasContext context = (JmeCanvasContext) app.getContext();
Canvas canvas = context.getCanvas();
canvas.setSize(settings.getWidth(), settings.getHeight());
return canvas;
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
ex.printStackTrace();
}
return null;
}
示例3: createCanvas
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static Canvas createCanvas() {
String appClass = TestEditor.class.getName();
AppSettings settings = new AppSettings(true);
settings.setWidth(640);
settings.setHeight(480);
settings.setFrameRate(60);
try {
Class<? extends LegacyApplication> clazz = (Class<? extends LegacyApplication>) Class.forName(appClass);
LegacyApplication app = clazz.newInstance();
app.setPauseOnLostFocus(false);
app.setSettings(settings);
app.createCanvas();
app.startCanvas();
JmeCanvasContext context = (JmeCanvasContext) app.getContext();
Canvas canvas = context.getCanvas();
canvas.setSize(settings.getWidth(), settings.getHeight());
return canvas;
} catch (ClassNotFoundException | InstantiationException | IllegalAccessException ex) {
ex.printStackTrace();
}
return null;
}
示例4: getPanel
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
private Container getPanel() {
Dimension d3Dim = new Dimension (800, 600);
AppSettings settings = new AppSettings(true);
settings.setWidth(d3Dim.width);
settings.setHeight(d3Dim.height);
settings.setSamples(4);
settings.setVSync(true);
settings.setFrameRate(60);
setSettings(settings);
createCanvas();
JmeCanvasContext ctx = (JmeCanvasContext) getContext();
ctx.setSystemListener(this);
Canvas canvas = ctx.getCanvas();
canvas.setPreferredSize(d3Dim);
JPanel panel = new JPanel(new BorderLayout());
panel.add( canvas, BorderLayout.CENTER );
return panel;
}
示例5: createCanvas
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
private void createCanvas() {
AppSettings settings = new AppSettings(true);
settings.setWidth(640);
settings.setHeight(480);
settings.setFrameRate(60);
config = Util.getConfig();
viewer = new Viewer();
viewer.setPauseOnLostFocus(false);
viewer.setSettings(settings);
viewer.createCanvas();
viewer.startCanvas();
context = (JmeCanvasContext) viewer.getContext();
canvas = context.getCanvas();
canvas.setSize(settings.getWidth(), settings.getHeight());
}
示例6: main
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args){
Logger.getLogger("com.jme3").setLevel(Level.WARNING);
app = new TestAwtPanels();
app.setShowSettings(false);
AppSettings settings = new AppSettings(true);
settings.setCustomRenderer(AwtPanelsContext.class);
settings.setFrameRate(60);
app.setSettings(settings);
app.start();
SwingUtilities.invokeLater(new Runnable(){
public void run(){
final AwtPanelsContext ctx = (AwtPanelsContext) app.getContext();
panel = ctx.createPanel(PaintMode.Accelerated);
panel.setPreferredSize(new Dimension(400, 300));
ctx.setInputSource(panel);
panel2 = ctx.createPanel(PaintMode.Accelerated);
panel2.setPreferredSize(new Dimension(400, 300));
createWindowForPanel(panel, 300);
createWindowForPanel(panel2, 700);
}
});
}
示例7: main
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args){
TestVideoPlayer app = new TestVideoPlayer();
AppSettings settings = new AppSettings(true);
settings.setFrameRate(60);
app.setSettings(settings);
app.start();
}
示例8: SceneApplication
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public SceneApplication() {
super(new StatsAppState());
AppSettings newSetting = new AppSettings(true);
newSetting.setFrameRate(30);
newSetting.setCustomRenderer(AwtPanelsContext.class);
setSettings(newSetting);
setPauseOnLostFocus(false);
setShowSettings(false);
}
示例9: main
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args) throws BackingStoreException {
Locale.setDefault(Locale.ENGLISH);
MainApp app = new MainApp();
app.setPauseOnLostFocus(false);
app.setDisplayStatView(false);
app.setDisplayFps(false);
AppSettings settings = new AppSettings(false);
settings.load("SMILE");
settings.setTitle("SMILE");
settings.setSettingsDialogImage("Interface/line500px.png");
settings.setFrameRate(60);
settings.setSamples(2);
settings.putBoolean("DisableJoysticks", false);
settings.save("SMILE");
// settings.setVSync(true);
// settings.setResolution(800, 600);
// settings.setSamples(4);
// settings.setFullscreen(true);
// GraphicsDevice device = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
// DisplayMode[] modes = device.getDisplayModes();
// for (int i = 0; i < modes.length; ++i) {
// System.err.println(modes[i].getWidth() + "x" + modes[i].getHeight() + " " + modes[i].getRefreshRate()
// + " " + modes[i].getBitDepth());
// }
//
// int i = 10; // note: there are usually several, let's pick the first
// settings.setResolution(modes[i].getWidth(), modes[i].getHeight());
// settings.setFrequency(modes[i].getRefreshRate());
// settings.setBitsPerPixel(modes[i].getBitDepth());
//// settings.setFullscreen(device.isFullScreenSupported());
app.setSettings(settings);
app.setShowSettings(true);
app.start(); // restart the context to apply changes
}
示例10: main
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args) {
AppSettings settings = new AppSettings(true);
settings.setResolution(640, 480);
settings.setSamples(4);
settings.setTitle("Projection");
settings.setFrameRate(40);
ProjectTest app = new ProjectTest();
app.setSettings(settings);
app.setShowSettings(false);
app.setPauseOnLostFocus(false);
app.start();
}
示例11: main
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args) {
AppSettings settings = new AppSettings(true);
settings.setFrameRate(60);
SceneLoadTest test = new SceneLoadTest();
test.setSettings(settings);
test.start();
}
示例12: create
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
/**
* 創建遊戲,默認幀率60.
* @param appClass
* @param width
* @param height
*/
public static void create(String appClass, int width, int height) {
AppSettings settings = new AppSettings(true);
settings.setResolution(width, height);
settings.setFrameRate(60);
create(appClass, settings, new VBox());
}
示例13: start
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
private void start() {
AppSettings settings = new AppSettings(true);
settings.setResolution(1280, 720);
settings.setFrameRate(90);
settings.setSamples(4);
Jfx.create(Editor.class.getName(), settings);
Jfx.getMainFrame().setLocationRelativeTo(null);
Jfx.getMainFrame().setVisible(true);
Jfx.getMainFrame().setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
Jfx.getMainFrame().setIconImages(createIcons());
Jfx.getMainFrame().addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
super.windowClosing(e);
Quit.doQuit(); // 由Quicker負責退出
}
});
// 開始構建JFX界麵
// 這裏要等待JmeApp執行完simpleInit方法之後再開始執行Jfx UI,因為UI要依賴於JME的初始化
Jfx.runOnJme(() -> {
Jfx.runOnJfx(() -> {
UIManager.initializeLayout(Jfx.getJfxRoot());
});
});
}
示例14: start
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
@Override
public void start(Stage stage) throws Exception {
AppSettings settings = new AppSettings(true);
// 這裏必須把初始化時的分辨率調高一些,最好剛好或大於整個屏幕,因為一些jmeContext(如LwjglOffscreenBuffer)會
// 使用分辨率來初始化Pbuffer,但是Pbuffer在運行過程無法重建,即大小無法調整,這會導致如果一開始太小則當窗口調整
// 時,渲染窗口生成的圖片無法覆蓋整個窗口。
settings.setResolution(width, height);
settings.setFrameRate(30);
// setKeepResolution保持分辨率不要太大,以節省性能。
jfxView = JfxSystem.startApp(TestEditor.class.getName(), settings);
jfxView.setResolutionLimit(width, height);
jfxView.setUseDepthBuffer(true);
// Button btn = new Button();
// btn.setText("Stop JFX Application");
// btn.setOnAction(e -> {
// Platform.exit();
// });
StackPane root = new StackPane();
root.setBackground(Background.EMPTY);
root.getChildren().add(jfxView);
// root.getChildren().add(btn);
Scene scene = new Scene(root);
scene.setFill(new Color(0f, 0f, 0f, 0f));
jfxView.fitWidthProperty().bind(scene.widthProperty());
jfxView.fitHeightProperty().bind(scene.heightProperty());
jfxView.setEffect(new DropShadow());
stage.setTitle("Hello World!");
stage.setScene(scene);
stage.initStyle(StageStyle.TRANSPARENT);
stage.show();
}
示例15: main
import com.jme3.system.AppSettings; //導入方法依賴的package包/類
public static void main(String[] args) {
AppSettings settings = new AppSettings(true);
settings.setResolution(1024, 768);
settings.setFrameRate(60);
Editor app = new Editor();
app.setSettings(settings);
app.setShowSettings(false);
app.start();
}