tarek2's Recent Forum Activity

  • > thank you very much it worked you are amazing, now tell me how do i resize the tile in real time after being selected just like in this image?

    I want the player to be able to resize some tiles to make it easier, and prevent the CPU from getting overloaded with hundreds of mini tiles on the screen

    Np glad it was helpful)

    I suppose you are referring to resizing a TileMap instance, not a single sprite?

    Here is one way of doing it:

    Not sure the logic you had in mind to trigger the Tile Auto Resizing but here I did it by:

    Shift Is Down

    ---Touch Is in Touch: >>>> Resize TileMap

    You can change it to your like if you had something else in mind

    Note:

    Here there is just one TileMap so its easy to pick it up but if you think you gonna have more than one Tile in the layout you will need to pick the right one before you resize, I will just put a simple Boolean "Active" and on Tile clicked set Active = True

    And deactivate all the other ones.

    https://www.dropbox.com/s/ifvuhv477rmw430/Resize%20Map.c3p?dl=0

  • Hello,

    I want to get same position values with different screen sizes. I am using Touch.AbsoluteX and Y but when I change browser window sizes, values are getting different but sprite is in same background point.

    You should get the same values on any screen size if you use the normal:

    Touch.x

    Touch.Y

    The Screen size It shouldn't affect the values unless you scale (Layout/Layers)

  • Dropbox drop support for host files many years ago as people used to abuse hosting games etc... in there so now they block that feature as you will get now:

    "blocked by CORS policy: No 'Access-Control-Allow-Origin' header "

    The best option is to find a free hosting service and upload your image there and use AJAX

    Here is how you load an image into a sprite using AJAX

  • Instead, when i (somehow) sense that the image was replaced in the folder with a new image, then i want to load the new image into the sprite.

    And, as mentioned, the simplest case i am looking at right now is that there always only exists one image in the folder which is displayed on screen.

    app running locally on an android tablet

    Nw.js only works for Pc

    It reads from a local folder (which happens to be a dropbox folder)

    For that, you gonna need a third-party plugin I believe not sure if there is any for C3, I think there used to be one for c2 but not really sure.

    The best solution is to work with local storage so you can save the Image and have control over when they replace it, this option will much easier to do.

    Though if you need to update the image for them then it may be better to have it in a server and use Ajax to load the Picture.

    Let's see if someone else has a better idea of how to work with DropBox so it can help you, I personally never used it.

  • when i try to move a bigger object it gives these jerks how can i move smoothly in 32.32 ?

    It works fine for me:

    https://www.dropbox.com/s/robc1y4xbj84bai/Grid%20Move.c3p?dl=0

    Judging from the Picture have you added an event to cover?:

    On Drop:

    Set X = round(Self.X /32) * 32

    Set Y = round(Self.Y /32) * 32

  • If you are using the Nw.js read

    Then what you do is:

    1-Nw.js read Binary File into the binary data Plugin

    2-Wait for previous action to complete

    3-Here as you say that you need to save the image to load any other time then you can save it as Base64 into an Array, Dictionary, etc...And whenever you want to load the image just load it from that base64 that you saved.

    Note:

    If you just wanna save it in Local Storage then you don't need to convert it to base64 as you can just save it as binary data

  • Could it be that you created many objects instead of one by mistake??

    You can go to the debuger and check how many objects have been created, if it's not that then I have no idea.

  • Hard to know without seeing how you set up your spawn areas and Turrets but if you:

    Example

    Have sprites as Spawn areas for each turret then you can do:

    Turret On Destroyed:

    --SubEvent: "Spawn Areas" Pick the closest to (Turret.X, Turret.Y)

    ----"Spawn Areas" Spawn New Turret

    Note:

    Don't forget to exclude the "Spawn Area" from Picking of the Turret that you just destroyed

  • Thank you. It works with sprites if the event setup is global...but nothing works with the dynamically created button element.

    Mm not sure what you mean, have you tested the two examples that I posted? both are working for me

    Remember that you need to check for Touch in a subevent of the same event that spawns the button because if you don't the button will not be available till the next top-level event which is when is added to the system but it will be available in all subevents.

    However, you can pass the UID and pick it up again and check for Touch if you need to check for touching from somewhere else.

  • Add them to a Family and add an instance variable "Circle_Number"

    then to pick the objects just add one condition:

    Family.Circle_Number ="Your Target Number"

    This will pick just that circle but if you want to loop through all of them you can do a "For each" Family then you can do a subevent to pick the ones you need.

  • Form buttons don't work with Touch as you need to use its own trigger "On Clicked" to register the click.

    However, you can make it work in two ways:

    1-Create an invisible object with each button that you spawn so you can use "is touching" as you do now

    https://www.dropbox.com/s/tdgj8eht1nyjvfb/Detect%20Button.c3p?dl=0

    or

    2-Check BBoxes, I think this one is better because you don't need any extra invisible objects

    https://www.dropbox.com/s/ubyt48pqbt9hu8i/Detect%20Button2.c3p?dl=0

    An alternative to those you can use just sprites as Buttons

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • can you explain a bit more about your logic how it should work? is hard to debug without looking at your project.

    What your events do at the moment is

    1-Pick all the "Empty" slots that are not "onlyonce" >>>> and set empty to false and onlyonce to true

    The question is if you send one axe in the function why are you setting all the slots that picks the conditions? shouldnt you pick just one slot?

    Check on the Debug and make sure there is at least one slot that have:

    -Empty = true

    -onlyonce = false

    So the else can Run when the slotfull is = 6

    If you still cannot find the issue share a small demo to look at it.

tarek2's avatar

tarek2

Early Adopter

Member since 26 Jan, 2016

Twitter
tarek2 has 12 followers

Trophy Case

  • 8-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x5
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

15/44
How to earn trophies