Bug Issue: The "[Actor] is on screen" bock does not work properly.


Pages: 1

LIBERADO

  • Expert Stencyler
  • *
October 14, 2017, 05:15:50 pm
My new game does not work well due to this bug:
   

   
Stencyl mistakenly believes that actors on these positions are not on screen when using this block:
This is a bug that often bothers me.

Please, fix it.
« Last Edit: October 14, 2017, 05:37:53 pm by LIBERADO »


yoplalala

  • Subscriber - Stencyl Studio
  • *
October 15, 2017, 01:17:58 am
Code: [Select]
public function isOnScreen():Bool
{
var cameraX = Engine.cameraX / Engine.SCALE;
var cameraY = Engine.cameraY / Engine.SCALE;

var left = Engine.paddingLeft;
var top = Engine.paddingTop;
var right = Engine.paddingRight;
var bottom = Engine.paddingBottom;

return (physicsMode > 0 || body.isActive()) &&
   getX(true) >= -cameraX - left &&
   getY(true) >= -cameraY - top &&
   getX(true) < -cameraX + Engine.screenWidth + right &&
   getY(true) < -cameraY + Engine.screenHeight + bottom;
}

Here is the code.
Code: [Select]
getX  and getY
//Big Change: Returns relative to the origin point as (0,0). Meaning if the origin = center, the center is now (0,0)!

So isActorOnScreen depends on the origin point ( which was not the case before, when ??)


I was wondering. Instead of just checking the origin point, maybe it could check if the scaled actor  rectangle intersects with the screen rectangle ?
Like this it would taking scaling in account.


LIBERADO

  • Expert Stencyler
  • *
October 15, 2017, 05:54:20 am
Quote from: yoplalala
So isActorOnScreen depends on the origin point ( which was not the case before, when ??)
No. It dependes on the upper left corner, which is even worse.
 
this block is useless because it takes into account only the upper left corner of the actors, which does not make any sense.
   
It should take into account the entire actor body, as this block does: 

I would like this old bug to be fixed.
« Last Edit: October 15, 2017, 06:03:37 am by LIBERADO »


Issue updated by Justin - February 01, 2018, 10:57:21 am
  • Tags added: 3.5 NP


rob1221

  • Master Stencyler
  • *
March 13, 2018, 11:55:00 am
Fixed in b9792.
  • Status changed from New to Resolved
  • Issue Assigned from (none) to rob1221
  • Tags removed: 3.5 NP


LIBERADO

  • Expert Stencyler
  • *
March 13, 2018, 11:58:34 am
Thanks!


Pages: 1

Details

  • Reported
    October 14, 2017, 05:15:50 pm
  • Updated
    March 13, 2018, 11:58:34 am

  • View Status
    Public
  • Type
    Bug
  • Status
    Resolved
  • Priority
    Normal
  • Version
    Stencyl 3.4, Stencyl 3.5, 3.5.0 beta 1
  • Fixed in
    (none)
  • Assigned to
    rob1221
  • Category
    (none)

Tags