content top

G3D Utility – Giavapps 3D

G3D Utility – Giavapps 3D

  G3D Utility   PLEASE NOTE: these functions are available for GameMaker Studio 2 only! If you are not familiar with cameras (introduced in GameMaker Studio 2) and matrices you may find useful Giavapps 3D utility functions listed on this page.   G3D Projection   Giavapps 3D provides the following functions for drawing projections. In order to use projections you must toggle Enable Viewports (in the Room Editor or through code with the function view_enabled) and make them visible.   g3d_projection_set_perspective(ViewIndex, FieldOfView, FromX, FromY, FromZ, ToX, ToY, ToZ, UpX, UpY, UpZ) This function sets a perspective projection for the specified view. ViewIndex: Index of the view (number from 0-7). FieldOfView: The angle of the field of view. FromX: The x coordinate of the position to look from. FromY: The y coordinate of the position to look from. FromZ: The z coordinate of the position to look from. ToX: The x coordinate of the position to look to. ToY: The y coordinate of the position to look to. ToZ: The z coordinate of the position to look to. UpX: The x coordinate of the “up” vector. UpY: The y coordinate of the “up” vector. UpZ: The z coordinate of the “up” vector.   g3d_projection_set_orthographic(ViewIndex, FromX, FromY) This function sets an orthographic projection for the specified view. ViewIndex: Index of the view (number from 0-7). FromX: The x coordinate of the position to look from. FromY: The y coordinate of the position to look from.   G3D Transformations   g3d_transform_set(X, Y, Z, RotationX, RotationY, RotationZ, ScaleX, ScaleY, ScaleZ) This function sets a perspective projection for the specified view. X: The x component of the transform vector. Y: The y component of the transform vector. Z: The z component of the transform vector. RotationX: The x component of the transform vector. RotationY: The y component of the transform vector. RotationZ: The z component of the transform vector. ScaleX: The x scale amount. ScaleY: The y scale amount. ScaleZ: The z scale amount.   g3d_transform_set_identity() This will set the origin of the 3D world to location 0,0,0 (which is the center of the world). This means that you can define an object at this point and then perform transforms on it to change its angle, scale, or position without worrying about the actual room coordinates. It is important to end transformation afterwards, using the same command.   Code Examples   Setting a Perspective Projection   g3d_projection_set_perspective(0, 45, x, y, z, target.x, target.y, target.z, 0, 0, –1);//set perspective projection   Setting Transformations   g3d_transform_set(0, 0, 0, 0, 0, 0, 32, 32, 32);//set transformation g3d_object_draw_self();//draws the G3D Object previously assigned to the instance g3d_transform_set_identity();//reset transformations   I am Luigi Piscopo,...

Read More

G3D Fog – Giavapps 3D

G3D Fog – Giavapps 3D

  G3D Fog   PLEASE NOTE: these functions are available for GameMaker Studio 2 only! gpu_set_fog(Enable, Colour, Start, End) function which you can find in GameMaker Studio 2 is not supported by Giavapps 3D Shaders since this function does not work correctly for Shaders at the moment (this feature could be added in the future). You can use g3d_fog_set() function instead.   g3d_fog_set(Enabled, Red, Green, Blue, Start, End) This function can be used to enable or disable fog drawing. Fog can be used in 3D games to make instances in the distance look blurred or even disappear, which helps in creating atmosphere as well as masking the fact that you are not drawing instances that are far away. You set whether it is enabled (true) or disabled (false), the colour that the fog should use for blending, as well as the start and end draw distances. Note that the fog start indicates the radius relative to the view camera where the fog starts, and the fog end indicates at which radius (also relative) instances will be completely invisible. Enabled: Enables (true) or disables (false) fog drawing. Red: Red component value from 0 to 1+. Green: Green component value from 0 to 1+. Blue: Blue component value from 0 to 1+. Start: Start draw distance. End: End draw distance.   g3d_fog_get(FogFlag) This function can be used to retrieve the fog settings. FogFlag: fog flag. FogFlag argument can be one of the following constants: G3D_FOG_ENABLED Returns whether the fog is enabled (true) or disabled (false). G3D_FOG_R Returns the red component value. G3D_FOG_G Returns the green component value. G3D_FOG_B Returns the blue component value. G3D_FOG_START Returns the start draw distance. G3D_FOG_END Returns the end draw distance.   Code Examples   Enabling Fog Drawing   g3d_fog_set(1, 1, 0, 0, 300, 1000);//enables fog drawing with the specified settings   I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and...

Read More

Giavapps Lens Flare

Giavapps Lens Flare

  Giavapps Lens Flare   Giavapps Lens Flare (developed and produced by Luigi PiscopoHe is the same developer of the Giavapps Windows API, Giavapps MIDI, Giavapps ProAudio, Giavapps CC, Giavapps File, Giavapps 3D and Giavapps Controller extensions for GameMaker: Studio!) provides a set of functions for creating a realistic 2D Lens Flare effect in GameMaker Studio and GameMaker Studio 2. With this Extension you can easily generate and customize a stunning Lens Flare effect in no time. Giavapps Lens Flare Extension automatically interpolates Glowing, Rotation, Flickering and Colour based on various variables which you can easily customize. This Extension has been tested on the following target platforms: Windows Mac OS X Android     Key Features Fully customizable, sprite-based, 2D Lens Flare effect. Automatically animated with a customizable Flickering feature. Automatically interpolates several properties like Glowing, Rotation, Flickering and Colour. Includes objects, sprites and one room for testing. You can also use your own sprites with this Extension. Well documented, inexpensive, easy to use, lightweight and cross-platform.   Documentation   Giavapps Lens Flare Lens Flare Object (GiavappsLensFlare.gml)   Giavapps Lens Flare is available on GameMaker: Marketplace!   $3.99 $9.99   LIMITED PROMO! 74% OFF!   BUY IT NOW!   I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and...

Read More

Lens Flare Object – Giavapps Lens Flare

Lens Flare Object – Giavapps Lens Flare

  Giavapps Lens Flare Initialization   glf_lens_flare_init(X, Y, SpriteLensFlare, SpriteRay, SpriteGlare, Color) Initializes all local variables for the lens flare. X: determines the x position of the lens flare. Y: determines the y position of the lens flare SpriteLensFlare: determines the lens flare sprite. SpriteRay: determines the ray sprite. SpriteGlare: determines the glare sprite. Color: determines the color of the lens flare. Once you’ve initialized a GameMaker: Studio Object with this function you gain access to the following local variables: x determines the x position of the lens flare. y determines the y position of the lens flare. glowing determines the glowing level of the lens flare. (Value From 0+) (Default Value: 1) glowing_speed determines the glowing speed of the lens flare. (Value From 1+) (Default Value: room_speed*2) rotation determines the rotation of the lens flare. (Value From 0 to 359) (Default Value: 0) rotation_speed determines the rotation speed of the lens flare. (Value From 1+) (Default Value: room_speed*8) flickering_enabled determines whether the flickering is enabled (true) or not (false). (Default Value: true) flickering determines the flickering chances of the lens flare. (Value From 1+) (Default Value: room_speed*8) flickering_factor determines the flickering factor of the lens flare. (Value From 0+) (Default Value: 0.15) color determines the color of the lens flare (for example c_white). color_speed determines the speed when merging the color of the lens flare. (Value From 1+) (Default Value: room_speed) sprite_lens_flare determines the lens flare sprite. This could be sprite_giavapps_lens_flare_01 or any other lens flare sprite of your choice. sprite_ray determines the ray sprite. This could be sprite_giavapps_lens_flare_ray_01 or any other ray sprite of your choice. sprite_glare determines the glare sprite. This could be sprite_giavapps_lens_flare_glare_01 or any other glare sprite of your choice.   Giavapps Lens Flare Functions   glf_lens_flare_step() Updates the lens flare. This function must be called inside the Step Event of the lens flare.   glf_lens_flare_draw() Draws the lens flare. This function must be called inside the Draw Event of the lens flare.   Code Examples   Creating a Giavapps Lens Flare Object   Create Event   glf_lens_flare_init(x, y, sprite_giavapps_lens_flare_01, sprite_giavapps_lens_flare_ray_01, sprite_giavapps_lens_flare_glare_01, c_white);//initializes all local variables for the lens flare   Step Event   glf_lens_flare_step();//updates the lens flare   Draw Event   glf_lens_flare_draw();//draws the lens flare   Controlling Giavapps Lens Flare Effect from another Object   Step Event   var lens_flare = GiavappsLensFlareObject;//sets a temporary variable to the lens flare object lens_flare.rotation = point_direction(lens_flare.x, lens_flare.y, mouse_x, mouse_y); //rotates the lens flare object based on the mouse position   I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing,...

Read More

Giavapps Controller

Giavapps Controller

  Giavapps Controller   Giavapps Controller (developed and produced by Luigi PiscopoHe is the same developer of the Giavapps Windows API, Giavapps MIDI, Giavapps ProAudio, Giavapps CC, Giavapps File and Giavapps 3D extensions for GameMaker: Studio!) provides a set of easy to use and cross-platform Controllers for GameMaker Studio and GameMaker Studio 2. Giavapps Controller Extension is perfect for game developers who want to target multiple platforms, With this Extension you can quickly set up two kind of Giavapps Controllers and instead of calling different keyboard, gamepad, mouse or device_mouse functions you will be able to map Keyboard Keys and Gamepad Inputs to a single Controller Object that handles all different inputs for you. Besides you can also hide the visibility of a Giavapps Controller on a specific platform: by doing so Mouse Clicks and Touch Inputs will be ignored while Keyboard Keys and Gamepad Inputs will be still detected. This Extension has been tested on the following target platforms: Windows Mac OS X Android   Key Features Includes Giavapps Controller Stick and Giavapps Controller Button. Each Giavapps Controller supports Mouse Clicks, Multi-Touch, Gamepad Inputs and Keyboard Inputs. Support for remapping Keyboard Keys and Gamepad Inputs assigned to a Giavapps Controller. Well documented, inexpensive, easy to use, lightweight and cross-platform.   Documentation   Giavapps Controller Stick (GiavappsController.gml, GiavappsControllerStick.gml) Button (GiavappsController.gml, GiavappsControllerButton.gml)   Giavapps Controller is available on GameMaker: Marketplace!   $3.99 $9.99   LIMITED PROMO! 74% OFF!   BUY IT NOW!   I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and...

Read More

Button – Giavapps Controller

Button – Giavapps Controller

  Giavapps Controller Button Initialization   gc_button_init(X, Y, KeyboardButton, GamepadButton, Sprite) Initializes all local variables for the button controller. X: x position of the button controller. Y: y position of the button controller. KeyboardButton: keyboard key to assign to the button controller. GamepadButton: gamepad input to assign to the button controller. Sprite: sprite image of the button controller. This image will be also used as mask_index for collision checking. Once you’ve initialized a GameMaker: Studio Object with this function you gain access to the following local variables: visible indicates if the button controller should be visible or not. Mouse Clicks and Touch Inputs will be ignored when the button controller is invisible but Keyboard Keys and Gamepad Inputs will be still detected. x x position of the button controller. y y position of the button controller. keyboard_button keyboard key assigned to the button controller. gamepad_button gamepad input assigned to the button controller. gamepad_device Indicates the gamepad device "slot". (Default Value: 0) sprite sprite image of the button controller. mask_index collision mask. This should be the same as sprite image usually. press indicates if the button controller is held down (true) or not (false). (Default Value: false) pressed indicates if the button controller has been pressed (true) or not (false). (Default Value: false) released indicates if the button controller has been released (true) or not (false). (Default Value: false)   Giavapps Controller Button Functions   gc_button_alarm0() Updates pressure states of the button controller. This function must be called inside the Alarm 0 Event of the button controller.   gc_button_step() Updates the button controller. This function must be called inside the Step Event of the button controller.   gc_button_draw_gui() Draws the button controller on the GUI Layer. This function must be called inside the Draw GUI Event of the button controller.   Giavapps Controller Button Sprites     Giavapps Controller Button Sprites can be any size of your choice (we used a 160×160 pixels for Sprite image) but you should remember centering the origin of the sprite (if needed) and marking Precise Collision Checking box for precise collision checking. The Sprite argument of gc_button_init() function also defines the mask_index used for collision checking.   Code Examples   Creating a Giavapps Controller Button   Create Event   gc_button_init(view_wview[0]-560, view_hview[0]-160, ord(‘X’), gp_face2, sprite_giavapps_controller_button_1);//initializes all local variables for the button controller   Alarm 0 Event   gc_button_alarm0();//updates pressure states of the button controller   Step Event   gc_button_step();//updates the button controller   Draw GUI Event   gc_button_draw_gui();//draws the button controller   Using Giavapps Controller Button States   Step Event   var button = GiavappsControllerButton;//sets a temporary variable to the button controller object if(button.pressed) { show_debug_message("Giavapps Controller Button has been...

Read More
content top