X3M's Forum Posts

  • Here is another contest with the same prize of 10.000 $ : http://adoptmygame.com

    The deadline is : 31st August.

    The good thing is that there will be portal owners and investors watching.

    Good luck to everyone and thanks for the info

  • Pretty sure that would be dis.yourMom

    Glad you're good sport, between I've just noticed that you're also a member of the FGL community.

  • What is this useful for? Just curious. The manual mentions the relevant ones, whereas much of the rest are helper functions used by the runtime that isn't useful to a plugin dev.

    They are useful if you are not using the c2canvas like I'm doing.

    I think he was just doing this.kitchenSink.

    No I was just doing this.yourMom.

    • this.

      • Members:

        type,runtime,recycled,uid,puid,iid,get_iid,toString,extra,instance_var_names,instance_vars,behavior_insts,properties,is_contained,siblings

      • Functions:

        get_iid,toString,onCreate,tick,tick2,onDestroy,saveToJSON,loadFromJSON,draw,drawGL,getDebuggerValues,onDebugValueEdited

    • this.type.

      • Members:

        plugin,runtime,name,is_family,instvar_sids,vars_count,behs_count,fx_count,sid,members,family_index,families, family_var_map,family_beh_map,family_fx_map,is_contained,container,texture_file,texture_filesize,texture_pixelformat, animations,index,instances,deadCache,solstack,cur_sol,default_instance,default_layerindex,stale_iids,updateIIDs,collision_grid,any_cell_changed,any_instance_parallaxed,extra,toString,behaviors,global,isOnLoaderLayout,effect_types,tile_poly_data

      • Functions:

        updateIIDs,getFirstPicked,getPairedInstance,getCurrentSol,pushCleanSol,pushCopySol,popSol,getBehaviorByName,getBehaviorIndexByName,getEffectIndexByName,applySolToContainer,getInstanceByIID,toString,onCreate

    • this.runtime

      • Members:

        isCrosswalk,isCordova,isPhoneGap,isDirectCanvas,isAppMobi,isCocoonJs,isEjecta,isDomFree,isMicrosoftEdge,isIE,isTizen, isAndroid,isiPhone,isiPad,isiOS,isiPhoneiOS6,isChrome,isAmazonWebApp,isFirefox,isSafari,isWindows,isNWjs,isNodeWebkit, isArcade,isWindows8App,isWindows8Capable,isWindowsPhone8,isWindowsPhone81,isWindows10,isWinJS,isBlackberry10, isAndroidStockBrowser,devicePixelRatio,isMobile,isWKWebView,httpServer,httpServerUrl,isDebug,canvas,canvasdiv, gl,glwrap,glUnmaskedRenderer,enableFrontToBack,earlyz_index,ctx,fullscreenOldMarginCss,firstInFullscreen,oldWidth, oldHeight,width,height,draw_width,draw_height,cssWidth,cssHeight,lastWindowWidth,lastWindowHeight,forceCanvasAlpha, redraw,isSuspended,plugins,types,types_by_index,behaviors,layouts,layouts_by_index,eventsheets,eventsheets_by_index, wait_for_textures,triggers_to_postinit,all_global_vars,all_local_vars,solidBehavior,jumpthruBehavior,shadowcasterBehavior, deathRow,hasPendingInstances,isInClearDeathRow,isInOnDestroy,isRunningEvents,isEndingLayout,createRow,isLoadingState, saveToSlot,loadFromSlot,loadFromJson,lastSaveJson,signalledContinuousPreview,suspendDrawing,fireOnCreateAfterLoad,dt, dt1,minimumFramerate,logictime,cpuutilisation,rendertime,rendercpu,eventstime,eventscpu,timescale,kahanTime,wallTime, last_tick_time,fps,last_fps_time,tickcount,execcount,framecount,objectcount,collisioncheck_count,collisioncheck_sec, polycheck_count,polycheck_sec,movedcell_count,movedcell_sec,movedrendercell_count,movedrendercell_sec,physics_cpu, hit_breakpoint,step_break,resuming_breakpoint,breakpoint_event,breakpoint_action,breakpoint_condition,changelayout, destroycallbacks,event_stack,event_stack_index,localvar_stack,localvar_stack_index,trigger_depth,loop_stack, loop_stack_index,next_uid,next_puid,layout_first_tick,family_count,suspend_events,raf_id,timeout_id,isloading, loadingprogress,isNodeFullscreen,stackLocalCount,audioInstance,had_a_click,isInUserInputEvent,objects_to_pretick, objects_to_tick,objects_to_tick2,registered_collisions,temp_poly,temp_poly2,allGroups,groups_by_name,cndsBySid, actsBySid,varsBySid,blocksBySid,running_layout,layer_canvas,layer_ctx,layer_tex,layout_tex,layout_canvas, layout_ctx,is_WebGL_context_lost,uses_background_blending,fx_tex,fullscreen_scaling,files_subfolder,objectsByUid, loaderlogos,snapshotCanvas,snapshotData,objectRefTable,name,first_layout,fullscreen_mode,fullscreen_mode_set, original_width,original_height,parallax_x_origin,parallax_y_origin,uses_loader_layout,loaderstyle,system, audio_to_preload,pixel_rounding,aspect_scale,enableWebGL,linearSampling,alphaBackground,versionstr,useHighDpi, orientations,autoLockOrientation,pauseOnBlur,wantFullscreenScalingQuality,fullscreenScalingQuality,downscalingQuality, preloadSounds,projectName,start_time,isRetina,overlay_canvas,overlay_ctx,tickFunc,progress,last_progress

      • Functions:

        tickFunc,requestProjectData,initRendererAndLoader,setSize,tryLockOrientation,onContextLost,onContextRestored, positionOverlayCanvas,setSuspended,addSuspendCallback,GetObjectReference,loadProject,waitForImageLoad, findWaitingTexture,getready,areAllTexturesAndSoundsLoaded,go,draw_c2_splash_loader,go_loading_finished, tick,logic,onWindowBlur,doChangeLayout,runLayoutChangeMethods,pretickMe,unpretickMe,tickMe,untickMe,tick2Me, untick2Me,getDt,draw,drawGL,addDestroyCallback,removeDestroyCallback,getObjectByUID,DestroyInstance,ClearDeathRow, IterateDeathRow,ClearDeathRowForType,ClearDeathRowForSingleInstance,createInstance,createInstanceFromInit, getLayerByName,getLayerByNumber,getLayer,clearSol,pushCleanSol,pushCopySol,popSol,updateAllCells, getCollisionCandidates,getTypesCollisionCandidates,getSolidCollisionCandidates,getJumpthruCollisionCandidates, testAndSelectCanvasPointOverlap,testOverlap,testTilemapOverlap,testRectOverlap,testSegmentOverlap,typeHasBehavior, typeHasNoSaveBehavior,typeHasPersistBehavior,getSolidBehavior,getJumpthruBehavior,testOverlapSolid,testRectOverlapSolid, testOverlapJumpThru,pushOutSolid,pushOut,pushInFractional,pushOutSolidNearest,registerCollision,checkRegisteredCollision,c alculateSolidBounceAngle,trigger,triggerOnSheet,triggerOnSheetForTypeName,executeSingleTrigger,getCurrentCondition, getCurrentConditionObjectType,isCurrentConditionFirst,getCurrentAction,pushLocalVarStack,popLocalVarStack, getCurrentLocalVarStack,pushEventStack,popEventStack,getCurrentEventStack,pushLoopStack,popLoopStack,getCurrentLoop, getEventVariableByName,getLayoutBySid,getObjectTypeBySid,getGroupBySid,doCanvasSnapshot,debugBreak,debugResume, signalContinuousPreview,stepIfPausedInDebugger,handleSaveLoad,saveToJSONString,refreshUidMap,loadFromJSONString, saveInstanceToJSON,getInstanceVarIndexBySid,getBehaviorIndexBySid,loadInstanceFromJSON,fetchLocalFileViaCordova, fetchLocalFileViaCordovaAsText,fetchLocalFileViaCordovaAsArrayBuffer,fetchLocalFileViaCordovaAsURL,setImageSrc

  • You do not have permission to view this post

  • Here are some functions that I use to draw shapes on the Construct 2 renderer.

    Box:

    renderSquare(this, renderer,cr.RGB(0,0,255));[/code:3573wm0c]
    [code:3573wm0c]function renderSquare(inst, renderer,color) {
    	var q = inst.instance.GetBoundingQuad();
    	renderer.Outline(q, color);
    }[/code:3573wm0c]
    Circle:
    [code:3573wm0c]renderCircle(this, renderer,cr.RGB(0,0,0),18);[/code:3573wm0c]
    [code:3573wm0c]
    function renderCircle(inst, renderer, color,segments) {
    	var q = inst.instance.GetBoundingQuad();
    	var xpos = (q.tlx + q.trx + q.blx + q.brx) / 4;
    	var ypos = (q.tly + q.try_ + q.bly + q.bry) / 4;
    	xsto = new cr.vector2(inst.instance.GetSize().x / 2, 0);
    	ysto = new cr.vector2(inst.instance.GetSize().y / 2, 0);
    	rcos = Math.cos((Math.PI / (segments/2)))
    		rsin = Math.sin((Math.PI / (segments/2)))
    		for (var i = 0; i < segments; i++) {
    			xsto.x = ysto.x * rcos - ysto.y * rsin;
    			xsto.y = ysto.x * rsin + ysto.y * rcos;
    			renderer.Line(new cr.vector2(xpos + xsto.x, ypos + xsto.y), new cr.vector2(xpos + ysto.x, ypos + ysto.y), color);
    			q.tlx = xpos + xsto.x;
    			q.tly = ypos + xsto.y;
    			q.trx = xpos + ysto.x;
    			q.try_ = ypos + ysto.y;
    			q.blx = xpos;
    			q.bly = ypos;
    			q.brx = xpos;
    			q.bry = ypos;
    			ysto = new cr.vector2(xsto.x, xsto.y);
    		}
    }
    [/code:3573wm0c]
    Polyline:
    [code:3573wm0c]drawPolyline("641 96 435 99 434 186 634 181 641 95 688 45 689 138 633 180 435 98 513 50 688 45",cr.RGB(255, 0, 0), this.instance,renderer);[/code:3573wm0c]
    [code:3573wm0c]function drawPolyline(points,color, inst,rend) 
    {
    			var q = inst.GetBoundingQuad();
    			var xpos = (q.tlx + q.trx + q.blx + q.brx) / 4;
    			var ypos = (q.tly + q.try_ + q.bly + q.bry) / 4;
    			var fq = new cr.quad;
    			var diffx,diffy;
    			var pArray = [];
    			pArray = points.split(" ");
    			if (xpos > pArray[0]) {
    				diffx = xpos - pArray[0];
    				diffx *= -1;
    			} else {
    				diffx = pArray[0] - xpos;
    			}
    			if (ypos > pArray[1]) {
    				diffy = ypos - pArray[1];
    				diffy *= -1;
    			} else {
    				diffy = pArray[1] - ypos;
    			}
    			for (var i = 0; i < pArray.length; i += 2) {
    				rend.Line(new cr.vector2(pArray[i] - diffx, pArray[i + 1] - diffy), new cr.vector2(pArray[i + 2] - diffx, pArray[i + 3] - diffy), color);
    			}
    
    }[/code:3573wm0c]
    
    You may find these useful when making your own plugins.
  • X3M

    If you think it's a big improvement, you should consider creating your own separate div plug.

    No it doesn't affect the performance, the plugin is great, I just criticized the method used to include the canvas .

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Pode created a DIV outside the DIV that contains the c2canvas, He called it "divSVG" , check his demo : https://dl.dropboxusercontent.com/u/141 ... index.html

    In my opinion, I don't think it should be like that, He made a looping JQuery function that adjusts the size and position of the div at each tick. I believe this can be done in a better way if you simply put your canvas on top of the c2canvas.

    This is what I mean:

    If you can, send me your code by PM and I'll try to set it up for you

    2) How do I create a div and fill colour exactly on top of the physical bounds of a plugin? I tried using the bbox and the quad properties and it seems that they all gives 0s for all the values in onCreate. When I console.log(this) for the plugin, I see bbox has left, top etc. values, but when I try to log (this.bbox) it gives all zeros. Also, when I use these values to set the values for the new div, it is setting all zeroes.

    Those are Edittime functions, they do not work at Runtime. Are you talking about drawing on the Construct 2 Editor layout or the Browser canvas ?

  • Thanks you very much X3M, that was superfast!!. Let me try this out.

    By the way, I checked our the BabylonJS. Pretty cool! Will you be publishing it in the store? When?

    Yep , At the end of November, by the time I've verified each function.

  • Thats because the c2canvas (Construct 2 canvas ) overlays yours.

    Try this :

    		
    instanceProto.onCreate = function()
    {
    var svgcanvas = document.createElement('svgcanvas');
    var c2canvas = document.getElementById('c2canvas');
    var maindiv = this.runtime.canvas.parentNode;
    svgcanvas.id = "svgCanvas";
    svgcanvas.style.position = "absolute";
    c2canvas.style.position = "absolute";
    maindiv.style.position = "relative";
    svgcanvas.style.width = 100 + "%";
    svgcanvas.style.height = 100 + "%";
    svgcanvas.style.left = 0 + "px";
    svgcanvas.style.top = 0 + "px";
    svgcanvas.style.zIndex = 1;
    c2canvas.style.zIndex = 0;
    
    this.svg = document.createElement('svg');
    svgcanvas.appendChild(this.svg);
    this.svg.width=this.width;
    this.svg.height=this.height;
    var viewBox = "0 0 "+ this.width+ " " + this.height;
    this.svg.setAttribute("viewBox",viewBox);
    this.SNAP = Snap(this.svg);
    
    // Create big blue circle in the middle:
    var bigCircle = this.SNAP.circle(40, 40, 80);
    bigCircle.attr({
    fill: "#0000FF",
    stroke: "#000",
    strokeWidth: 5
    });
    // Create another small black circle:
    var smallCircle = this.SNAP.circle(40, 40, 35);	
    };
    [/code:2f6lmmgk]
    
    It should work, i made it for my upcoming babylonJS plugin.
  • Yep there seems to be a delay before your avatar changes ( a couple of minutes I guess ), clean your cache just to make sure its not your browser's fault.

  • I need a 3D artist who is capable of creating scenes with animations on either 3DS max or Blender for a future project.

  • I've got a question that has been boggling me, addons that get sold in the scirra store are used by the buyers in their games, so let's say someone who bought the addon decides to put his game's capx for sale, he is required then to include the addon, that he bought, with the capx, and this is where the problem lies. I mean I couldn't figure out a solution for this. Any suggestions ? I wanna put an addon for sale in the store but I don't want it to be published by the buyers with their capx.

  • Clones are source codes sold by the original authors of the game, there are some marketplaces where you can sell your full source code for a decent price.

  • Check also : chrome://gpu

    I'm not using Chrome, imho its overrated and uses an unjustifiable high amount of CPU, Firefox is the way to go for testing your projects since its the most WebGL compatible browser at this time.

    Also if you check this article: https://www.khronos.org/webgl/wiki/Blac ... Whitelists

    You'll notice that Google Chrome has some compatibilty issues with a lot of graphic cards. So mayb your GPU and Chrome don't go well together.