User Tools

Site Tools


tutorial:screen

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
tutorial:screen [2023/04/21 10:45] – [Scrolling] solidblocktutorial:screen [2023/05/04 10:32] – [Creating a screen] solidblock
Line 1: Line 1:
 ====== Creating a screen ====== ====== Creating a screen ======
  
-A **screen** is a graphical user interface that extends ''Screen'', allowing the user to interact and fulfill some functionalities. One example of a screen is a custom config screen of your mod. Screens only exist in the client, so you must annotate them with ''@Environment(EnvType.CLIENT)''.+A **screen** is a graphical user interface that extends ''Screen'', allowing the user to interact and fulfill some functionalities. One example of a screen is a custom config screen of your mod. Screens only exist in the client, so you can annotate the relavant classes with ''@Environment(EnvType.CLIENT)''.
  
 You may use mixins to add into an existing screen a button that goes to your screen. But in many cases, we can implement the ''ModMenuApi'' of Mod Menu mod, and make it possible to access the screen via the config button in the Mod Menu screen. This article does document how to implement ''ModMenuApi''. You may use mixins to add into an existing screen a button that goes to your screen. But in many cases, we can implement the ''ModMenuApi'' of Mod Menu mod, and make it possible to access the screen via the config button in the Mod Menu screen. This article does document how to implement ''ModMenuApi''.
Line 143: Line 143:
  
   * ''<yarn class_4280>'' refers to a widget in which you can select a row. In widgets that extends the class, you usually select one entry in the list. Some vanilla examples are biome selection screen in the buffet (single biome) world option, and the language selection screen.   * ''<yarn class_4280>'' refers to a widget in which you can select a row. In widgets that extends the class, you usually select one entry in the list. Some vanilla examples are biome selection screen in the buffet (single biome) world option, and the language selection screen.
-  * ''<yarn class_4265>'' refers to a widget where each row has multiple elements. In widgets that extends this class, you select and interacts the elements in the rows. Like a ''Screen'', the ''<yarn class_4265>.<yarn class_4266>'' should have zero, one, or more children elements.+  * ''<yarn class_4265>'' refers to a widget where each row has child elements. In widgets that extends this class, you select and interacts the elements in the rows. Like a ''Screen'', the ''<yarn class_4265>.<yarn class_4266>'' should have zero, one, or more child elements.
  
 ===== Things to check before finishing ===== ===== Things to check before finishing =====
tutorial/screen.txt · Last modified: 2023/12/18 01:38 by solidblock