Skip to content

Commit

Permalink
Blending in 2D should automatically work
Browse files Browse the repository at this point in the history
  • Loading branch information
michaliskambi committed Sep 29, 2024
1 parent 438a7d1 commit d4f595a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions htdocs/doc/blending.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ Moreover, the following 2 sorting options are available but _deprecated_. Most c
////
==== Manually doing sorting
An alternative to using cgeref:TCastleViewport.BlendingSort[] is to sort manually by an explicit call to a method cgeref:TCastleTransform.SortBackToFront2D[Viewport.Items.SortBackToFront2D] or more general cgeref:TCastleTransform.SortBackToFront[Viewport.Items.SortBackToFront].
An alternative to using cgeref:TCastleViewport.BlendingSort[] is to sort manually by ... (methods no longer available in the engine).
You can also do it at design-time, from the CGE editor, using the _"Viewport -> Sort Items For Correct 2D Blending"_ menu item.
You can also do it at design-time, from the CGE editor, using the _"Viewport -> Sort Items For Correct 2D Blending"_ menu item (no longer available in the engine).
The drawback is that you have to do it often enough.
Expand Down
4 changes: 2 additions & 2 deletions htdocs/doc/viewport_2d.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ This creates a viewport with 2D navigation, 2D orthographic camera, and adds a d
- Y goes up,
- Z axis is "depth". Camera looks in the -Z direction. Larger Z means that object is closer to the camera (_in front_ of other objects), smaller Z means that it is further from the camera (_behind_ other objects). Is it OK to use negative Z values.
+
NOTE: For 2D objects will blending, you may (for now) need to sort the hierarchy after setting their Z, using _"Viewport -> Sort Items For Correct 2D Blending"_.
Blending should automatically work for 2D viewports, see link:blending[blending] for details. In short, you can use partial transparency in your images, and it will work correctly in 2D viewports.

## Navigation in 2D

Expand Down

0 comments on commit d4f595a

Please sign in to comment.