Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

luiz734

5
Posts
1
Followers
2
Following
A member registered Oct 17, 2023 · View creator page →

Creator of

Recent community posts

I've created a new branch with the changes to the startup project and added a new slide explaining it as well.

(2 edits)

TL;DR: Use SubViewportContainers.

Hello. First, thank you for your feedback and for purchasing the asset.
Regarding your issue, I was able to solve it by using SubViewportContainer instead of TextureRect.
The main difference is that SubViewportContainer automatically propagate InputEvents to the viewport.

 Changes in the scene

- TextureFlipper (Node2D)
  - AfterFlipSubViewportContainer (SubViewportContainer) 
    - FlipViewport (SubViewport)
      - AfterFlipSubViewportContainer (SubViewportContainer) 
        - FlipViewport (SubViewport)
          - YourStuffGoesHere (Any)

It's kind of nested, but it's the way to go if you want to be able to flip it.

Now you need to change the way you flip, as SubViewportContainer has no flip_x or flip_y property. Instead, use the scale property like this:

# old snippet
texture_rect.flip_h = mirror_h
# new snippet
sub_viewport_container.scale.x = -1 if mirror_h else 1

You also need to check your rotation pivots.
Make sure they are in the center of the SubViewportContainer, or the content may seem like it disappears when it actually rotates to a place not visible in the SubViewportContainer.

While searching for solutions, I found that it is also possible to propagate the InputEvents manually by calling push_event on the viewport, but it seems easier to just use the SubViewportContainer. The related resources that helped me to solve this problem:

Using push_event (alternative method): https://docs.godotengine.org/en/4.2/classes/class_viewport.html#class-viewport-method-push-input

Using SubViewportContainer: https://forum.godotengine.org/t/passing-input-through-a-viewport-to-area2ds/37918

Using this approach, I was able to add hover animations to a TextureRect inside the viewport, and the shader is still working as intended. Let me know if you still have issues making it work.

Here it is the final result:


Thank you. Feel free to use it :)

I like the game. It feels very good to dash and explode the enemies, making them spawn arrows that clear the screen. As you make progress, it makes you feel powerful, but at the same time, the game doesn't get boringly easy over time. Good work.

Chaos, despair and power are how I would define it. I like the game. It feels very good to dash and explode the enemies, making them spawn arrows that clear the screen. As you make progress, it makes you feel powerful, but at the same time, the game doesn't get boringly easy over time. Good work.