warville's Forum Posts

  • i have an advice for you , i have been u sing C2 for a long time and i have tried manything , the best solution is Outer scale , the best resolution for mobile platforms is 480x854 and with applying the Outer scale it will fit almost devices perfectly , if you don't want the white space in sides , use the anchor behavior for the objects that doesn't need to be at an exact position for example the HUD the background ... the Menu they can all have the anchore behavior , and for object you will position with event sheet use the viewport expressions , this will perfectly fit your game on almost devices.

  • i'm not home right now , i will take a look when i get home, i don't have C2 on this computer

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • please upload a capx project file let me see what are you trying to do , i didn't understand you very well.

  • it doesn't work, maybe you uploaded the wrong version of the file.

  • hemm doesn't seem a good way to me , tretching and generally risizing sprites in the engine isn't professional at all , you must have the exact size ready made. don't stretch and scale.

  • there is no specifique size , first of all pcik your layout size , decent one for mobiles like ( 480x854 ) , then the character size depend on your game type and layout size will be obvious to you

  • images sizes depends on the platform , second 190 is very fine for a desktop , but for a mobile you don't even need that size for a small mobile screen.

  • i have made a solution to you problem using only one sprite object for a road using frames as parts : it works 100%

    • if the part is in correct order and you droped it close to the previous one it will stick to the right position
    • if the part is not in the right order it will go back to the original position.

    as i have seen in the solution above you need a lot of work to make stick in the right position.

    here is the event-sheet below it may look conplicated but it work correctly:

  • What you have made is strange. Please try to do it as i suggested. Make different sprites for each part part1 part2 part3 and don't forget to set position on other sptrite on image point(1) not (0) because 0 is used already in the previous one.

  • i don't understand what you are trying to do ? why you need different frames ? just differents sprites ! using instance of the same sprite is complicated because you can,'t make condition (is overlaping) on instances of the same sprite it's very complicated.

  • i have got an idea :

    make 2 images points for each road part , the first is the man image point (0) call it (bottom) and place it in the beginning, add another image point (1) call it "top" and it's obvious place it in the end of the" part. give each part a value call it order(integer) to test if the roads are correctly ordered or not .

    then when you drage and drop a road part , make a test

    if that sprite_level1_part2.order = sprite_level1_part1.order + 1 then {

    • set the position of sprite_level1_part2 to other object at image point "top" or (1) .

    // construct 2 will place the sprite based on it's principal image point so it will be in the right position

    }

    else if the sprite_level1_part2.order # (Not equal to ) sprite_level1_part1.order + 1

    then place it back to it's original position.

    i didn't try this i just hade it in my minde , i hope it works as i thought.

  • i will try to optimise it for you guys and implement if needed

  • i think i understand you very well , you want to do this without arrays , here i suggest a solution

    a full shope system for you from placing sprites to picking the bought weapons for the character.

    1st - for the s_sword_icon sprite make 2 animation containing the sword famres in the first animation is just the sword icone , or locked , and the second have th e same frames but with the indication that the sword was bought and make a variable for the s_sword_icon name it sword_number make the default value <varies> construct 2 will now that there will be different value for each instance and second value for the price (sword_cost) and third value isbough=false and it's optional if you want a power for each weapon add another value name it sword_power(integer or float).

    2nd - in the shope make a sprite that will work as a slot i mean where the sword_icon should appear ( somthing like boxes , make them instances from the same sprite lets name it sword_slot make 2 values for each instance one name it to isbought(boolean) a second value is slot_number(integer) ather values are sword_cost and sword_power

    -- here to fill the not bought slots

    3rd -in the event-sheet (Trigger event + AND for each s_sword_slot AND s_sword_slot.isbough=false )

    * create new object ( s_sword_icon)

    * set s_sword_icon animation frame to (s_sword_slot.slot_number)

    * set s_sword_icon.sword_num to (s_sword_slot.slot_number)

    * set s_sword_icon.sword_cost to s_sword_slot.sword_cost

    * set s_sword_icon.sword_power to s_sword_slot.sword_power

    * set s_sword_icon.isbought=false

    * set s_sword_icon position to another object "s_sword_slot".

    -- here to fill the already bought slots:

    4th - ( Trigger event + for each s_sword_slot AND s_sword_slot.isbough=true )

    * create new object ( s_sword_icon)

    * set s_sword_icon.animation ("nimation2")

    * set s_sword_icon.animation frame to (s_sword_slot .slot_number)

    * set s_sword_icon.isbought=true

    * set s_sword_icon.sword_num to (slot_number)

    * set s_sword_icon.sword_cost to (array_swords.X[s_sword_slot.slot_number])

    * set s_sword_icon.sword_power to (array_swords.Y[s_sword_slot.slot_number])

    * set s_sword_icon position to another object "s_sword_slot".

    -- here the buying operation

    5th - (on double touched object s_sword_icon AND on double touched object s_sword_slot AND s_sword_icon.isbough=false and s_sword_ico.sword_cost <= total_money )

    -- here you can make the buying actions such as :

    * set s_sword_slot.isbought=true

    * set s_sword_icon.isbought=true

    * set s_sword_icon.animation ("nimation2")

    * set s_sword_icon.animation frame to (s_sword_icon.sword_number)

    * substract from total _money ( s_sword_icon.sword_cost)

    -- here you can select the sword you bought

    6th - (on touched object s_sword_icon AND s_sword_icon.isbough=true )

    -- here you can make sword selection actions such as :

    * set s_sword.animation frame to (s_sword_icon.sword_number)

    * set s_sword.power to (s_sword_slot.sword_power)

    if you need to understand somthing i'm here, i'm sorry i know it looks confusing i made the solution in my head i don't have the project opened so i couldn't explain more.

  • no it's not possible for my case , i need all the textbox feature scroll down, append text , make new line, copy/past ....

    when i set it to read-only mode i lose almost features. thats why i'm trying to keep it write and read more with preventing the keyboard to show , because i have my own keyboard.

  • Eh, it's pretty easy. If you're good at describing requirements I'll make one for you real quick. Hopefully the good karma will get my answers helped too

    I'm just not sure where to put the variable so it's accessible, so let me know how it's going to be used.

    What if I made a behavior for text objects that reacted to a "update to clipboard contents" action?

    oh that's exciting , maybe you just make it separate plugin , that doesn't have visual object , this plugin gives you 1 value : maybe name it textclip. this value returned by the plugin is the text in the clipboard , if there is a text , and not picture or somthing else. and perform one action set text to clipboard. i know this isn't gonna be very usefull to many people. it's a good idea maybe somepeople going to need it.

    but i have a question for you please , for sure you know more than me you might have the answer.

    i want to prevent the default mobile keyboard from showing when textbox gain focus i don't need the android onscreen keyboard. i found on internet that it can be done with ( onFocus=blure ) inside the input tags but in construct 2 i don't know how to apply it.