konterball's Recent Forum Activity

  • Hi,

    the goal/problem is this: I need free space around the game (top, right, bottom and left) to display banner ads and/or a navigation bar. Unfortunately, these elements need to be on top of (over) the game, so I need to make sure these don't overlap any game UI elements.

    For the bottom and right side it's pretty easy: I just reduce window.innerHeight and window.innerWidth by x pixels after export and the game thinks it's smaller and adjusts accordingly. No problem!

    For the top and left side this works in some frameworks with marginTop and marginLeft (so moving the canvas further down or to the right). But not in Construct 3. This is where a pointer issue occurs. When you click on a button (as an example), the new (visual) position of the button is not taken into account, but the original one. Not good :)

    Questions:

    1.) Is there a way to solve this pointer issue after exporting? So to let the subsequently set values of marginLeft and marginTop flow into other variables?

    2.) If this has to be solved in the game. What would be the most elegant method?

    I tried adding a spacer. In landscape it should be on the left side (width of x pixels, full height) and in portrait mode at the top (full width, with x pixels height).

    Is there a behavior that could make this easier for me?

    I tried this manually:

    On the one hand, I have problems setting the full width/height, and on the other hand, the value for height or width (e.g. 100px) seems to get smaller or larger when resizing. In short, it doesn't seem to work front or back.

    My goal? If I have a spacer, I could position the UI element based on this spacer.

    Basically, this seems to be a very complicated and time-consuming method. Isn't there an easier way?

    Thanks a million in advance!

  • Hi,

    I would like to know how the IndexedDB name is generated for the projects (e.g. "c3-localstorage-qtd9m4wizxb").

    Does this happen at the very beginning when the project is created and can therefore no longer be changed?

    I would have guessed that this was somehow related to the project ID, but apparently not.

    The problem I currently have is that if I reskin a game and, in extreme cases, only exchange assets, they still share the same database. Or what else do I have to change so that this doesn't happen anymore?

    I changed the project name, ID and even the version. When exporting, however, the "qtd9m4wizxb" was still to be found in the data.json.

    Thanks in advance :)

  • Ok, my question isn't just about "below the canvas", it's about all sides:

    How can I manage to shrink the canvas so that I have a black area where I could place ad banners without the risk of them covering game UI elements.

    Below the game you can do this for a 60px area like this: window.innerHeight = window.innerHeight - 60;

    Of course, this is only intended as an example and is not a good idea to override innerHeight.

    However, Construct's resize function uses window.innerHeight.

    The easiest way would be to wrap a container around the canvas. Reserve a space there and the canvas will only take up the space that is still available. Is something like this possible?

    Or is there another approach that makes more sense? In worst case, I would also be satisfied with the bottom and the right side only :)

    Thanks in advance!

  • Well, I am a step further.

    Using "object" as type and JSON as object, I can access to instance variables via _instVars. At least i get the keys and their type. But how do i access their values?

    Thanks!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi,

    i created a plugin with an action called "TrackEvent", the 2nd param should be an object with key-value pairs, for example: {level: 10, score: 20, stars: 2}. The keys can change, so the structure must be variable.

    How to solve this properly? I mean you only can use string, number and boolean as data types.

    Maybe using the type "object" and then work with the JSON of C3?

    But then how i access the data in my plugin action method? console.log shows me "C3.ObjectClass" for this parameter. How I should proceed?

    Or is there a better way?

    Thanks in advance!

    Tagged:

  • Ashley, could you please tell me how to get a list of all the files (names) that are in "Sounds" and "Music"? Like "AddAudioFileParam" does it.

    I would like to set them in my plugin as source for the Howler object. Thanks :)

  • Yes, i know that. As i said, I couldn't believe it either, but they have assured me that only MP3 is possible in their "special" environment.

    Anyway, I started today to create a plugin for them that uses Howler... Lucky me, that my game only uses "Play", "Set Silent" and "Is Silent", so it should be easy to accomplish :)

  • Yes, I feel like you too. I don't want to give any names here, of course, but the game should be integrated into their app (android apk) and I was told that they would not support OGG and M4A / MP4 and I had to convert that to MP3 by myself.

  • I have a problem: The target platform on which my game should run does not support OGG or M4A.

    Crazy, but that's the way it is. Is it possible to force MP3 in any way for my project? Maybe via an external plugin or certain adjustments that I would have to make after exporting?

    Thanks a lot for any help!

    Tagged:

  • Hi there,

    getting the error "ReferenceError: window is not defined", but i don't have any clue where to put code as follows:

    window["game"].pause = function() {
    	self.Trigger(C3.Plugins.MyPluginName.Cnds.OnGamePause);
    };
    

    I tried different places, but window has never been defined. Has to be a place where I have access to "inst" as well.

    Thanks a lot :)

    Tagged:

  • Thanks for your fast answer!

    Yes, i know that suspending the runtime while showing ads is a little bit "misused" and not the intended use case.

    "The solution is to either remove the opportunity for input events to reach the runtime, or don't suspend the runtime."

    Not suspending the runtime is no option, cause i need to pause AND mute the game. If there is alternative way I'm glad to hear it :)

    How i can remove the opportunity for input events to reach the runtime? Is there a runtime function to manage this? To switch it on and off? This would help me a lot!

    Thanks :)

  • Hi there,

    I'm not sure if this is a bug. If not, maybe you can see it as a suggestion for a next update ;)

    I found out that the game (runtime) while suspended doesn't ignore player inputs, for example a tap gesture. You tap in the suspended game and the actions of this condition will be executed after the suspension finishes.

    It would be very great if any interactions with a suspended game would be ignored.

    I use setSuspended(true) while showing ads (game pauses and mutes). I don't know why but if the player skips an ad this touch event goes "through" the ad overlay right to the game. So if for example a sprite is placed under this "skip" area of the ad its actions will be executed after the ad closes although the game had been suspended in the first place.

    As a workaround I created a "isAdShowing" condition in my addon and use it (inverted) combined with all used touch conditions in my project, but this doesn't seem very elegant.

    It is possible to avoid this behavior of the runtime in the first place or what i can do to solve this issue in a better way?

konterball's avatar

konterball

Member since 10 Jan, 2019

None one is following konterball yet!

Trophy Case

  • 5-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

7/44
How to earn trophies