View Issue Details
| Category | |||||
|---|---|---|---|---|---|
| SSPBT:本体(SSP) | |||||
| Severity | feature | Reproducibility | N/A | ||
| Status | new | ||||
| Summary | 0000795: How to get surface width before the surface is displayed | ||||
| Description | I keep running into an issue when I create ghosts that have background decorations. I want to spawn characters at random positions on screen, but in order to keep the characters within the screen boundaries, I need to check the width of the surface that the character will use. However, I don't want the user to see the character before it moves to its position, otherwise it creates an unpleasant flickering effect. Usually, I try to solve it like this: \p[100]\![set,alpha,0]\s[100]\![get,property,OnCheckWidth,currentghost.scope(100).rect] However, I've found that when the alpha tag is used first, it seems that the surface is initialized to 10 (if no other surface was already in use), and therefore the property command gets the width of surface10 instead. (Also, OnChangeSurface detects a change to surface10, and only later updates to reflect the intended surface.) If I swap the order of the tags like this... \p[100]\s[100]\![set,alpha,0]\![get,property,OnCheckWidth,currentghost.scope(100).rect] Then the width will be correct, but sometimes the character is briefly visible before the alpha tag takes effect. I'm not sure if it would be possible to adjust that behavior, and it seems like a bad idea for me to rely on really specific timing of these events. I had another idea: would it be possible to add a property command to detect what the rectangle of a surface will be, without having to change to it? That would solve my issue cleanly, without having to rely on events happening in just the right order. Something like this: \![get,property,OnCheckWidth,currentghost.scope(100).surface(100).rect] | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-07-20 03:18 | guest | New Issue |