Skip to main content

Setting Boundaries for Your Action Figure in 2D: Using the Node Class LocalToParent Attribute

  • Chapter
  • First Online:
Book cover Beginning Java 8 Games Development
  • 2615 Accesses

Abstract

Now that we have organized your Java code into logical methods in the InvinciBagel.java class, and wired up the GamePlayLoop .handle() method to the Bagel .update() method in Chapter 10, to make sure that our KeyEvent handlers will move our InvinciBagel character around the screen, it is time to establish some boundaries for our game hero, so that he does not leave the field of play, so to speak. To do this, we will need to dive into the JavaFX Node superclass at a much deeper level of detail then we did in Chapter 4. We will look at how transforms are performed, and more important, how they function relative to the Parent Node, which is located above them in the Scene Graph. For our Actor ImageView Node(s), that Parent Node would be the Scene Graph root StackPane Node.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 49.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Wallace Jackson

About this chapter

Cite this chapter

Jackson, W. (2014). Setting Boundaries for Your Action Figure in 2D: Using the Node Class LocalToParent Attribute. In: Beginning Java 8 Games Development. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-0415-3_12

Download citation

Publish with us

Policies and ethics