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. 2D Blocks
  4. Blocks for Dragging Sprites

Blocks for Dragging Sprites

Scheduled Pinned Locked Moved 2D Blocks
1 Posts 1 Posters 1.4k 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

     

    Prerequisite

    • Working with Sprites

     

    Description

    To work with the dragging event, you need these 3 Hat blocks in the “Events” category: “When dragging starts”, “When being dragged” and “When dragging stops”.


     

    Full Screen Drag Mode

    By default, you can not drag a sprite in the full screen mode.

    To make a sprite draggable in the full screen stage, you have to use the “Set drag mode” block from the sensing category, set drag mode.PNG and select “draggable” from the drop down menu. set drag mode3.PNG

    Here is how you can do it:


     

    “When Dragging Starts” Block

    This block will be triggered the moment you start dragging a sprite. For example, we can change the dog sprite’s costume to close its eyes when we start dragging it.


     

    “When Being Dragged” Block

    This block will run repeatedly while you drag a sprite on the stage (full screen mode only).


     

    “When Dragging Stops” Block

    This block runs when you stop dragging a sprite and release your mouse. In this example below, we make the dog go back to the center of stage whenever we stop dragging it.


     

    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