[plugin] Picture in Picture

0 favourites
  • 5 posts
From the Asset Store
An educational game for counting pictures. An easy to use template for developers to build larger games
  • Description

    Currently only works with WebGL disabled

    Picture in picture is an addon for Construct 2 which allows you to easily set up viewports within your game which capture other parts of the layout. It can be used to easily create split screen games or co-op games where seeing your partners view could help (see Portal 2 for example).

    The plugin adds a PiP object which is blank in the editor and is just a viewport, see the demo for example. This viewport can then be used to show any part of the current layout. So you could have a character with the scrollto behaviour and then have a PiP object in the corner which shows you another player.

    Properties

    Each PiP viewport has three properties:

    • Capture Type This can either be set to 'Display Relative' or 'Viewport Relative' and sets the base capture area for the viewport. If the option is set to 'Display Relative' the viewport will capture the entire screen and scale it into the canvas. If the option is set to 'Viewport Relative' the viewport will capture an area the size of the viewport.
    • Capture Scale This is a percentage which describes the area captured by the viewport, if the scale is 100, it will not scale the image further than Capture Type. If the scale is 50 the image displayed on the viewport will be 2x bigger than when it was captured etc.
    • Capture below This can either be true or false, it sets whether the viewport will capture the entire rendered screen or just layers below it (to prevent guis being captured etc).

    Actions

    The PiP object has 5 actions:

    • Enable/Disable viewport Sets whether the viewport is displaying what it is capturing.
    • Set viewport position Sets the location to be captured by the viewport.
    • Set capture type Sets the 'Capture Type' property as described above
    • Set capturing below Sets the 'Capture below' property as described above.
    • Set viewport scale Sets the 'Capture Scale' property as described above.

    Conditions

    The PiP object has no conditions.

    Expressions

    The PiP object has 6 expressions:

    • viewportcapturebelow Returns the value of the 'Capture below' property as an integer with 1 being true and 0 being false.
    • viewportcapturescale Returns the value of the 'Capture Scale' property as a float.
    • viewportcapturetype Returns the value of the 'Capture Type' property as an integer where 0 is 'Display Relative' and 1 is 'Viewport Relative'.
    • viewportenabled Returns whether the viewport is enabled as an integer with 1 being true and 0 being false.
    • viewportx Returns the x coordinate of the position the viewport is currently capturing.
    • viewporty Returns the y coordinate of the position the viewport is currently capturing.

    Download

  • Really good plugin but here is less than 20 frames

  • dellong to make it work properly, for every viewport I needed to re-render the screen so that it captured the correct area, and this is probably why it's so intensive. I will look into optimising as soon as possible.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Your demo .capx tells that it was using plugin version 1.1. However your .c2addon file is version 1.0. Can you provide a download link for PiP v.1.1 please?

  • Wolod I was making it for the next version, which I lost when I updated my pc. Sorry

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