当前位置: 首页>>代码示例>>Java>>正文


Java UIScreen类代码示例

本文整理汇总了Java中org.robovm.apple.uikit.UIScreen的典型用法代码示例。如果您正苦于以下问题:Java UIScreen类的具体用法?Java UIScreen怎么用?Java UIScreen使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


UIScreen类属于org.robovm.apple.uikit包,在下文中一共展示了UIScreen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication app, UIApplicationLaunchOptions launchOpts) {
  // create a full-screen window
  CGRect bounds = UIScreen.getMainScreen().getBounds();
  UIWindow window = new UIWindow(bounds);

  // create and initialize the PlayN platform
  RoboPlatform.Config config = new RoboPlatform.Config();
  config.orients = UIInterfaceOrientationMask.All;
  RoboPlatform pf = RoboPlatform.create(window, config);
  addStrongRef(pf);

  // create our game
  new CuteGame(pf);

  // make our main window visible (the platform starts when the window becomes viz)
  window.makeKeyAndVisible();
  addStrongRef(window);
  return true;
}
 
开发者ID:playn,项目名称:playn-samples,代码行数:21,代码来源:CuteGameRoboVM.java

示例2: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication app, UIApplicationLaunchOptions launchOpts) {
  // create a full-screen window
  CGRect bounds = UIScreen.getMainScreen().getBounds();
  UIWindow window = new UIWindow(bounds);

  // configure and create the PlayN platform
  RoboPlatform.Config config = new RoboPlatform.Config();
  config.orients = UIInterfaceOrientationMask.All;
  RoboPlatform plat = RoboPlatform.create(window, config);

  // create and initialize our game
  new Drop(plat);

  // make our main window visible (this starts the platform)
  window.makeKeyAndVisible();
  addStrongRef(window);
  return true;
}
 
开发者ID:playn,项目名称:playn-samples,代码行数:20,代码来源:DropRoboVM.java

示例3: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication app, UIApplicationLaunchOptions launchOpts) {
  // create a full-screen window
  CGRect bounds = UIScreen.getMainScreen().getBounds();
  UIWindow window = new UIWindow(bounds);

  // create and initialize the PlayN platform
  RoboPlatform.Config config = new RoboPlatform.Config();
  config.orients = UIInterfaceOrientationMask.All;
  RoboPlatform pf = RoboPlatform.create(window, config);
  addStrongRef(pf);

  // create our game
  new HelloGame(pf);

  // make our main window visible (the platform starts when the window becomes viz)
  window.makeKeyAndVisible();
  addStrongRef(window);
  return true;
}
 
开发者ID:playn,项目名称:playn-samples,代码行数:21,代码来源:HelloGameRoboVM.java

示例4: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication app, UIApplicationLaunchOptions launchOpts) {
  // create a full-screen window
  CGRect bounds = UIScreen.getMainScreen().getBounds();
  UIWindow window = new UIWindow(bounds);

  // create and initialize the PlayN platform
  RoboPlatform.Config config = new RoboPlatform.Config();
  config.orients = UIInterfaceOrientationMask.Landscape;
  RoboPlatform pf = RoboPlatform.create(window, config);
  addStrongRef(pf);

  new Physics(pf);

  // make our main window visible (the platform starts when the window becomes viz)
  window.makeKeyAndVisible();
  addStrongRef(window);
  return true;
}
 
开发者ID:playn,项目名称:playn-samples,代码行数:20,代码来源:PhysicsRoboVM.java

示例5: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication app, UIApplicationLaunchOptions launchOpts) {
  // create a full-screen window
  CGRect bounds = UIScreen.getMainScreen().getBounds();
  UIWindow window = new UIWindow(bounds);

  // configure and register the PlayN platform
  RoboPlatform.Config config = new RoboPlatform.Config();
  config.orients = UIInterfaceOrientationMask.All;
  RoboPlatform pf = RoboPlatform.create(window, config);

  // create and initialize our game
  TestsGame game = new TestsGame(pf, new String[0]);

  // make our main window visible
  window.makeKeyAndVisible();
  addStrongRef(window);
  return true;
}
 
开发者ID:playn,项目名称:playn,代码行数:20,代码来源:TestsGameRoboVM.java

示例6: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication app, UIApplicationLaunchOptions launchOpts) {
    // create a full-screen window
    CGRect bounds = UIScreen.getMainScreen().getBounds();
    UIWindow window = new UIWindow(bounds);

    // configure and create the PlayN platform
    RoboPlatform.Config config = new RoboPlatform.Config();
    config.orients = UIInterfaceOrientationMask.All;
    RoboPlatform plat = RoboPlatform.create(window, config);

    // create and initialize our game
    new SimGame(plat);

    // make our main window visible (this starts the platform)
    window.makeKeyAndVisible();
    addStrongRef(window);
    return true;
}
 
开发者ID:social-startup-game,项目名称:social-startup-game,代码行数:20,代码来源:SimGameRoboVM.java

示例7: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application,
		NSDictionary<NSString, ?> launchOptions) {
	
	window = new UIWindow(UIScreen.getMainScreen().getBounds());

	GenderListTableViewController genderListTableViewController = new GenderListTableViewController();
	UINavigationController navigationController = new UINavigationController(genderListTableViewController);
	navigationController.addStrongRef(genderListTableViewController);
	navigationController.setDelegate(new UINavigationControllerDelegateAdapter() {});
	window.setRootViewController(navigationController);
	window.setBackgroundColor(UIColor.colorWhite());
	window.makeKeyAndVisible();

	return true;
}
 
开发者ID:Kourtessia,项目名称:RoboVM-for-iOS,代码行数:17,代码来源:RoboVMTableViewApplicationDelegate.java

示例8: showAds

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
public void showAds() {
    initializeAds();

    final CGSize screenSize = UIScreen.getMainScreen().getBounds().size();
    double screenWidth = screenSize.height();
    double screenHeight = screenSize.width();
    

    final CGSize adSize = adview.getBounds().size();
    double adWidth = adSize.width();
    double adHeight = adSize.height();

    log.debug(String.format("Hidding ad. size[%s, %s]", adWidth, adHeight));
    float bannerWidth = (float) screenWidth;
    float bannerHeight = (float) (bannerWidth / adWidth * adHeight);
    log.debug(String.format("%s, %s, %s", screenWidth, screenHeight, bannerHeight));

    adview.setFrame(new CGRect(0, 
    		screenHeight - bannerHeight, 
    		bannerWidth, bannerHeight));
}
 
开发者ID:pierotofy,项目名称:snappyfrog,代码行数:22,代码来源:RobovmLauncher.java

示例9: viewDidLoad

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public void viewDidLoad() {
    super.viewDidLoad();

    UIImageView backgroundImageView = new UIImageView(UIScreen.getMainScreen().getApplicationFrame());
    backgroundImageView.setImage(UIImage.getImage("BackgroundLogin"));
    getView().addSubview(backgroundImageView);

    // Position of the Facebook button
    double yPosition = 360;
    if (UIScreen.getMainScreen().getBounds().getSize().getHeight() > 480f) {
        yPosition = 450;
    }

    facebookLoginButton = new FBSDKLoginButton();
    facebookLoginButton.setReadPermissions(Arrays.asList("public_profile", "user_friends", "email",
            "user_photos"));
    facebookLoginButton.setFrame(new CGRect((UIScreen.getMainScreen().getBounds().getWidth() - 244) / 2, yPosition,
            244, 44));
    facebookLoginButton.setDelegate(this);
    facebookLoginButton.setTooltipBehavior(FBSDKLoginButtonTooltipBehavior.Disable);
    getView().addSubview(facebookLoginButton);
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:24,代码来源:PAPLoginViewController.java

示例10: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
    // Metal samples can only be run on device
    if(System.getProperty("os.name").toLowerCase().contains("simulator")) {
        throw new Error("Metal samples can only be run on physical devices");
    }

    // Set up the view controller.
    rootViewController = new MetalBasic2DViewController();

    // Create a new window at screen size.
    window = new UIWindow(UIScreen.getMainScreen().getBounds());
    // Set the view controller as the root controller for the window.
    window.setRootViewController(rootViewController);
    // Make the window visible.
    window.makeKeyAndVisible();

    return true;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:20,代码来源:MetalBasic2D.java

示例11: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
    // Set up the view controller.
    streetScrollerViewController = new StreetScrollerViewController();

    // Create a new window at screen size.
    window = new UIWindow(UIScreen.getMainScreen().getBounds());
    // Set our viewcontroller as the root controller for the window.
    window.setRootViewController(streetScrollerViewController);
    // Make the window visible.
    window.makeKeyAndVisible();

    /*
     * Retains the window object until the application is deallocated. Prevents Java GC from collecting the window object too
     * early.
     */
    addStrongRef(window);
    return true;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:20,代码来源:StreetScroller.java

示例12: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
    // Set up the view controller.
    parentViewController = new ParentViewController();
    rootNavigationController = new UINavigationController(parentViewController);

    // Create a new window at screen size.
    window = new UIWindow(UIScreen.getMainScreen().getBounds());
    // Set our viewcontroller as the root controller for the window.
    window.setRootViewController(rootNavigationController);
    // Make the window visible.
    window.makeKeyAndVisible();

    // Attach an observer to the payment queue
    SKPaymentQueue.getDefaultQueue().addTransactionObserver(StoreObserver.getInstance());

    /*
     * Retains the window object until the application is deallocated.
     * Prevents Java GC from collecting the window object too early.
     */
    addStrongRef(window);

    return true;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:25,代码来源:InAppPurchases.java

示例13: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
    window = new UIWindow(UIScreen.getMainScreen().getBounds());
    window.setBackgroundColor(UIColor.white());
    /* Setup a tab bar controller that handles our custom view controllers */
    tabBarController = new UITabBarController();
    tabBarController.addChildViewController(new MyStreamingMovieViewController());
    tabBarController.addChildViewController(new MyLocalMovieViewController());

    /* Set the tab bar controller as the root of our window. */
    window.setRootViewController(tabBarController);
    window.makeKeyAndVisible();

    /*
     * Retains the window object until the application is deallocated. Prevents Java GC from collecting the window object too
     * early.
     */
    addStrongRef(window);

    return true;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:22,代码来源:MoviePlayer.java

示例14: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
    // Set up the view controller.
    rootViewController = new RegionsViewController();

    navigationController = new UINavigationController(rootViewController);

    // Create a new window at screen size.
    window = new UIWindow(UIScreen.getMainScreen().getBounds());
    // Set our viewcontroller as the root controller for the window.
    window.setRootViewController(navigationController);
    // Make the window visible.
    window.makeKeyAndVisible();

    /*
     * Retains the window object until the application is deallocated. Prevents Java GC from collecting the window object too
     * early.
     */
    addStrongRef(window);

    return true;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:23,代码来源:Regions.java

示例15: didFinishLaunching

import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
    // Set up the view controller.

    rootViewController = new ViewController();
    UINavigationController navController = new UINavigationController(rootViewController);
    navController.getNavigationBar().setBarStyle(UIBarStyle.Black);
    navController.getNavigationBar().setTranslucent(true);

    // Create a new window at screen size.
    window = new UIWindow(UIScreen.getMainScreen().getBounds());
    // Set the view controller as the root controller for the window.
    window.setRootViewController(navController);
    // Make the window visible.
    window.makeKeyAndVisible();

    return true;
}
 
开发者ID:robovm,项目名称:robovm-samples,代码行数:19,代码来源:App.java


注:本文中的org.robovm.apple.uikit.UIScreen类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。