Pasting with drawing canvas for split screen local MP

  • IIRC, with R0J0's paster/canvas plugins, the method was to shift the viewport, paste it to the canvas, then move the viewport back, resulting in two views. Please correct me if I'm wrong, since I never actually tried that plugin myself.

    Is this not possible with C3's drawing canvas due to the paste object action only happening at the end of each rendering frame and outside of the normal order of events and actions?

  • From the sound of it that is the case. I can understand it is more performant to do the pasting when everything else is drawn, but it does nerf its use in a lot of ways.

  • How do you do it in C3?

  • I had an idea to swap multiple canvas objects for each view from an off screen playing area to the viewport every other tick. So you would be seeing what happened one frame in the past.

    Seemed super clunky though, haven't tried it yet.

    The other way that has always worked is to basically render a copy of every object for every player, offset and on their own layer with blending modes to split the screen.

  • Is this not possible with C3's drawing canvas due to the paste object action only happening at the end of each rendering frame and outside of the normal order of events and actions?

    FYI that doesn't happen, it draws where the objects are at the time of the paste action. I think you're referring to an old bug where that happened, but the bug was fixed.

  • Oh! Sorry for the confusion. I was going by the manual entry where it said "If an object is destroyed the same tick that you paste it, it will not be drawn, since drawing happens at the end of the tick."

    I couldn't get it to work the way I imagined in a quick experiment. I'll give it another shot, must have done something wrong.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • The object is rendered at the end of the tick, but it's drawn at the position it was at the time of the paste action.

  • Looks like I had the wrong approach.

    Attempt 1:

    Anchor canvas to viewport

    Clear canvas

    System scroll to Player 2

    Paste everything to canvas

    System scroll to Player 1 (or scrollto behavior)

    Didn't work.

    Attempt 2:

    Clear canvas

    Move canvas object to player 2

    Paste objects to canvas

    Move canvas to viewport

    Scrollto Player 1 behavior

    Didn't work

    Attempt 3:

    Clear Canvas

    Scrollto Player 1

    Anchor canvas to viewport

    Offset every object by the difference between player 1 and player 2

    Paste to canvas

    Return objects to original position

    Works!

    I can see issues with the timing for my first try as I don't know how the behaviors order in terms of the event sheet stack. I would have hoped the second method would work... If i manually paste on trigger, I can move the canvas object around with the "stamped" image, so I would assume it works similarly within a tick.

    Also opacity changes don't seem to be recorded either.

    + (no conditions)

    -> DrawingCanvas: Clear canvas rgba(0, 0, 0, 0)

    -> Sprite: Set opacity to 100

    -> Sprite: Set position to (-200, 0)

    -> DrawingCanvas: Paste object Sprite without effects

    -> Sprite: Set opacity to 20

    -> Sprite: Set position to (0, 0)

    The canvas "copy" is saved at 20 opacity.

    Should I put it in a bug report? Or working as intended? Ref: dropbox.com/s/gg5kdjvbe4ovsck/splitscreenc3pminimal.c3p

    Edit: Formatting. Line breaks not working?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)