Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • CreatiCode
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

CreatiCode Scratch Forum

  1. CreatiCode Forum
  2. Knowledge Base
  3. 3D Blocks
  4. Rendering Layers

Rendering Layers

Scheduled Pinned Locked Moved 3D Blocks
1 Posts 1 Posters 789 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • CreatiCodeI Offline
    CreatiCodeI Offline
    CreatiCode
    wrote on last edited by admin
    #1

    Introduction

    In CreatiCode, you can place objects in different “rendering layers”. There are 4 rendering layers in total. All objects in layer 0 will be drawn on the stage first, followed by all objects in layer 1, etc. By default, all objects are in layer 0.

    Rendering layers can help you achieve very interesting visual effects, such as making one object always show on top of another object.

    The block to set the rendering layer for the current sprite object is:

    aa3ad68c-e23b-41f7-9f64-d8ec08c975d6-image.png

     
     

    Example 1 - Unblocking An Object

    In this example, we have placed a red sphere behind a green box:

    4900c394-08f1-4166-a857-53eaed91d772-image.png

     
    As a result, the sphere is blocked by the box:

    https://cdncreaticodecom.b-cdn.net/scratch-gui-projects/forum/49f9afcb-457d-46e6-878e-7a8d5915cfb0.gif" width="450" style="border-radius: 5px; border: 1px solid #29622d;">

     
    However, if we set the rendering layer of the sphere to 1, then it will be drawn after the box is drawn, so we can always see it completely. This is as if the box is allowing us to see the sphere through it.

    b2.gif

     
     

    Example 2 - Highlighting An Object

    The rendering layer is especially useful when we are highlighting an object. In this program, we are trying to highlight the sphere in yellow. The green box is semi-transparent, so we can see the sphere through it.

    cc1aa65b-59f0-4d66-94f0-9b09854e2d40-image.png

     
    However, the highlighting is not working for the sphere. The portion of the sphere that’s behind the box will all be covered in yellow, though we only want to show a yellow contour around it.

    b3.gif

     
    To solve this problem, we can move the red sphere to rendering layer 1. This way, we draw the sphere and its highlighting colors after the box is already drawn, so we get the correct result:

    b4.gif

     
    Whenever you need to highlight an object that’s blocked by another transparent object, you can use this technique.

     
    You can play with this example here:

    https://play.creaticode.com/projects/6eb3f6954926ab8db962ae20

    1 Reply Last reply
    0

    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

    With your input, this post could be even better 💗

    Register Login
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • CreatiCode