id stringlengths 6 6 | text stringlengths 20 17.2k | title stringclasses 1
value |
|---|---|---|
119078 | class_name Player
extends CharacterBody2D
signal coin_collected()
const WALK_SPEED = 300.0
const ACCELERATION_SPEED = WALK_SPEED * 6.0
const JUMP_VELOCITY = -725.0
## Maximum speed at which the player can fall.
const TERMINAL_VELOCITY = 700
## The player listens for input actions appended with this suffix.[br]
## Us... | |
119087 | extends Node
var tween: Tween
var sub_tween: Tween
@onready var icon: Sprite2D = %Icon
@onready var icon_start_position := icon.position
@onready var countdown_label: Label = %CountdownLabel
@onready var path: Path2D = $Path2D
@onready var progress: TextureProgressBar = %Progress
func _process(_delta: float) -> voi... | |
119106 | [node name="Camera2D" type="Camera2D" parent="."]
offset = Vector2(265, 247)
[node name="Player" parent="." instance=ExtResource("3")]
position = Vector2(120, 456)
[node name="SecretDetector" type="Area2D" parent="."]
position = Vector2(280, 440)
[node name="CollisionShape2D" type="CollisionShape2D" parent="SecretDe... | |
119111 | [gd_scene load_steps=4 format=2]
[ext_resource path="res://player/player.gd" type="Script" id=1]
[ext_resource path="res://player/player.png" type="Texture2D" id=2]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2(7, 7)
[node name="Player" type="CharacterBody2D"]
script = ExtResource( 1 )
[node name="S... | |
119113 | extends CharacterBody2D
const WALK_FORCE = 600
const WALK_MAX_SPEED = 200
const STOP_FORCE = 1300
const JUMP_SPEED = 200
@onready var gravity: float = ProjectSettings.get_setting("physics/2d/default_gravity")
func _physics_process(delta: float) -> void:
# Horizontal movement code. First, get the player's input.
va... | |
119199 | [gd_scene format=3 uid="uid://dv7rxhg55y3t6"]
[node name="StaticScene" type="Node2D"]
[node name="StaticBodyPolygon" type="StaticBody2D" parent="."]
position = Vector2(-7.85718, 399.596)
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="StaticBodyPolygon"]
build_mode = 1
polygon = PackedVector2Array(... | |
119201 | [gd_scene load_steps=2 format=3 uid="uid://cx2q80okt25o1"]
[sub_resource type="RectangleShape2D" id="1"]
size = Vector2(1600, 100)
[node name="StaticSceneFlat" type="Node2D"]
[node name="StaticBodyPolygon" type="StaticBody2D" parent="."]
position = Vector2(512, 550)
[node name="CollisionShape2D" type="CollisionShap... | |
119202 | [gd_scene load_steps=2 format=3 uid="uid://gk0nqu0jrwm"]
[sub_resource type="RectangleShape2D" id="1"]
size = Vector2(40, 40)
[node name="StackBox" type="RigidDynamicBody2D"]
position = Vector2(-180, -20)
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource( "1" ) | |
119203 | extends Test
const BOX_SIZE = Vector2(40, 40)
const BOX_SPACE = Vector2(50, 50)
@export_range(1, 1000) var row_size := 100
@export_range(1, 1000) var column_size := 100
var _objects: Array[Node2D] = []
var _log_physics := false
var _log_physics_time := 0
var _log_physics_time_start := 0
func _ready() -> void:
awa... | |
119215 | [gd_scene load_steps=7 format=3 uid="uid://dwka2imbe5gcs"]
[ext_resource type="Texture2D" uid="uid://c5duuyhbmd0m4" path="res://assets/texture/godot-head.png" id="1"]
[ext_resource type="Script" path="res://tests/functional/test_raycasting.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://blh3twy74kbkv" path="re... | |
119220 | [gd_scene load_steps=12 format=3 uid="uid://bxx2ftwccdlft"]
[ext_resource type="Script" path="res://tests/functional/test_character_pixels.gd" id="1"]
[ext_resource type="Script" path="res://utils/rigidbody_controller.gd" id="2"]
[ext_resource type="PackedScene" uid="uid://blh3twy74kbkv" path="res://tests/test_options... | |
119224 | extends TestCharacter
const OPTION_TEST_CASE_ALL = "Test Cases/TEST ALL (0)"
const OPTION_TEST_CASE_JUMP_ONE_WAY_RIGID = "Test Cases/Jump through one-way tiles (Rigid Body)"
const OPTION_TEST_CASE_JUMP_ONE_WAY_CHARACTER = "Test Cases/Jump through one-way tiles (Character Body)"
const OPTION_TEST_CASE_JUMP_ONE_WAY_CORN... | |
119227 | extends TestCharacter
const OPTION_TEST_CASE_ALL = "Test Cases/TEST ALL (0)"
const OPTION_TEST_CASE_DETECT_FLOOR_NO_SNAP = "Test Cases/Floor detection (Character Body)"
const OPTION_TEST_CASE_DETECT_FLOOR_MOTION_CHANGES = "Test Cases/Floor detection with motion changes (Character Body)"
const MOTION_CHANGES_DIR = Vec... | |
119229 | [gd_scene load_steps=15 format=3 uid="uid://bqmku5ewlo6j5"]
[ext_resource type="Script" path="res://tests/functional/test_character.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://blh3twy74kbkv" path="res://tests/test_options.tscn" id="3"]
[ext_resource type="Script" path="res://utils/slider.gd" id="3_cd5g0"]
... | |
119241 | extends RigidBody2D
var _initial_velocity := Vector2.ZERO
var _constant_velocity := Vector2.ZERO
var _motion_speed := 400.0
var _gravity_force := 50.0
var _jump_force := 1000.0
var _velocity := Vector2.ZERO
var _floor_max_angle := 45.0
var _on_floor := false
var _jumping := false
var _keep_velocity := false
func _rea... | |
119242 | extends Node
enum PhysicsEngine {
GODOT_PHYSICS,
OTHER,
}
var _engine: PhysicsEngine = PhysicsEngine.OTHER
func _enter_tree() -> void:
process_mode = Node.PROCESS_MODE_ALWAYS
# Always enable visible collision shapes on startup
# (same as the Debug > Visible Collision Shapes option).
get_tree().debug_collision... | |
119299 | class_name Player
extends CharacterBody2D
# Keep this in sync with the AnimationTree's state names.
const States = {
IDLE = "idle",
WALK = "walk",
RUN = "run",
FLY = "fly",
FALL = "fall",
}
const WALK_SPEED = 200.0
const ACCELERATION_SPEED = WALK_SPEED * 6.0
const JUMP_VELOCITY = -400.0
## Maximum speed at which... | |
119328 | [gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://blst65bnoqyam"]
[sub_resource type="Shader" id="1"]
code = "// original wind shader from https://github.com/Maujoe/godot-simple-wind-shader-2d/tree/master/assets/maujoe.simple_wind_shader_2d
// original script modified by HungryProton so that the asse... | |
119362 | extends Control
var dialogue_node: Node = null
func _ready() -> void:
visible = false
func show_dialogue(player: Pawn, dialogue: Node) -> void:
visible = true
$Button.grab_focus()
dialogue_node = dialogue
for c in dialogue.get_signal_connection_list("dialogue_started"):
if player == c.callable.get_object():... | |
119437 | extends CharacterBody2D
var movement_speed := 200.0
@onready var navigation_agent: NavigationAgent2D = $NavigationAgent2D
func _ready() -> void:
# These values need to be adjusted for the actor's speed
# and the navigation layout.
navigation_agent.path_desired_distance = 2.0
navigation_agent.target_desired_dista... | |
119522 | [gd_scene load_steps=12 format=3 uid="uid://jlfslyfbhid5"]
[ext_resource type="Script" path="res://logic/paddle.gd" id="1"]
[ext_resource type="Texture2D" uid="uid://dvrb8efddt0aa" path="res://paddle.png" id="2"]
[ext_resource type="Script" path="res://logic/ball.gd" id="4"]
[ext_resource type="Texture2D" uid="uid://c... | |
119534 | [gd_scene format=3 uid="uid://bywptem1jb35a"]
[node name="Explanations" type="RichTextLabel"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 10.0
offset_top = -370.0
offset_right = -10.0
offset_bottom = -730.0
size_flags_vertical = 4
mouse_filter = 2
bbcode_enabled = true
text = "This example... | |
119550 | extends Node2D
var bullet := preload("Bullet.tscn")
func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("fire"):
fire()
func fire() -> void:
if not $CooldownTimer.is_stopped():
return
$CooldownTimer.start()
var new_bullet := bullet.instantiate()
add_child(new_bullet)
new_bullet.p... | |
119559 | extends Label
var start_position := Vector2()
func _ready() -> void:
start_position = position
func _physics_process(_delta: float) -> void:
position = $"../BodyPivot".position + start_position
func _on_StateMachine_state_changed(current_state: Node) -> void:
text = String(current_state.name) | |
119590 | shader_type canvas_item;
uniform sampler2D screen_texture : hint_screen_texture, filter_linear_mipmap;
uniform float amount: hint_range(0.0, 5.0);
void fragment() {
COLOR.rgb = textureLod(screen_texture, SCREEN_UV, amount).rgb;
} | |
119603 | [node name="MovingPlatform1" type="CharacterBody2D" parent="."]
position = Vector2(268.651, 152)
[node name="Collision" type="CollisionShape2D" parent="MovingPlatform1"]
shape = SubResource("3")
[node name="Sprite2D" type="Sprite2D" parent="MovingPlatform1"]
modulate = Color(0.4, 2, 0.8, 1)
texture = ExtResource("2")... | |
119610 | extends Node
func _on_body_entered(body: Node2D) -> void:
if body.name == "Player":
$"../WinText".show() | |
119611 | [gd_scene load_steps=4 format=2]
[ext_resource path="res://player/player.gd" type="Script" id=1]
[ext_resource path="res://player/player.png" type="Texture2D" id=2]
[sub_resource type="RectangleShape2D" id=1]
extents = Vector2(7, 7)
[node name="Player" type="CharacterBody2D"]
script = ExtResource( 1 )
[node name="S... | |
119613 | extends CharacterBody2D
const WALK_FORCE = 600
const WALK_MAX_SPEED = 200
const STOP_FORCE = 1300
const JUMP_SPEED = 200
@onready var gravity := float(ProjectSettings.get_setting("physics/2d/default_gravity"))
func _physics_process(delta: float) -> void:
# Horizontal movement code. First, get the player's input.
v... | |
119627 | extends Area2D
signal hit
@export var speed = 400 # How fast the player will move (pixels/sec).
var screen_size # Size of the game window.
func _ready():
screen_size = get_viewport_rect().size
hide()
func _process(delta):
var velocity = Vector2.ZERO # The player's movement vector.
if Input.is_action_pressed(&"... | |
119667 | [node name="TopLight12" type="Polygon2D" parent="Ambient"]
light_mask = 512
material = SubResource("22")
position = Vector2(1042, -63)
scale = Vector2(0.296875, 1)
color = Color(1, 0.584314, 0, 0.341176)
texture = ExtResource("13")
polygon = PackedVector2Array(414.316, 138, -124.632, 59, 154.947, 16, 683.79, 92)
uv = P... | |
119695 | [gd_scene load_steps=3 format=2]
[ext_resource path="res://tileset/isotiles.png" type="Texture2D" id=1]
[sub_resource type="OccluderPolygon2D" id=2]
polygon = PackedVector2Array( 0, -100, -67, -68, -66, 0, -1, 33, 66, -2, 64, -67 )
[node name="TilesetEdit" type="Node2D"]
[node name="Base" type="Sprite2D" parent="."... | |
119700 | extends CharacterBody2D
const MOTION_SPEED = 160 # Pixels/second.
var last_direction = Vector2(1, 0)
var anim_directions = {
"idle": [ # list of [animation name, horizontal flip]
["side_right_idle", false],
["45front_right_idle", false],
["front_idle", false],
["45front_left_idle", false],
["side_left_idl... | |
119726 | extends CharacterBody2D
const MOTION_SPEED = 30
const FRICTION_FACTOR = 0.89
const TAN30DEG = tan(deg_to_rad(30))
func _physics_process(_delta: float) -> void:
var motion := Vector2()
motion.x = Input.get_axis(&"move_left", &"move_right")
motion.y = Input.get_axis(&"move_up", &"move_down")
# Make diagonal movemen... | |
119778 | #!/usr/bin/env bash
# vi:syntax=sh
APP_NAME="learn_to_code"
# This is used while developing to supply the `GODOT_VERSION` variable that is
# normally provided by the CI
local_godot_version=${GODOT_VERSION:-"3.4.4"}
######################################## HELP
help(){
if [ "$1" == "help" ]; then
echo "Show... | |
119891 | extends PanelContainer
signal toggled(is_pressed)
const OPTION_FONT := preload("res://ui/theme/fonts/font_text.tres")
const OPTION_SELECTED_FONT := preload("res://ui/theme/fonts/font_text_bold.tres")
var _button_text := ""
onready var _margin_container := $MarginContainer as MarginContainer
onready var _label := $... | |
119934 | extends Button
const EDITOR_EXPAND_ICON := preload("res://ui/icons/fullscreen_on.png")
const EDITOR_COLLAPSE_ICON := preload("res://ui/icons/fullscreen_off.png")
func _ready() -> void:
if OS.has_feature("JavaScript"):
modulate.a = 0.0
return
connect("pressed", self, "_toggle_fullscreen")
Events.connect("fulls... | |
119955 | extends Panel
const TEXTURE_PROCESSING := preload("robot_tutor_running_code.svg")
onready var _texture_rect := $Layout/TextureRect as TextureRect
func _ready() -> void:
_texture_rect.texture = TEXTURE_PROCESSING | |
119962 | extends Button
func _ready() -> void:
connect("pressed", get_tree(), "quit")
if OS.has_feature("JavaScript"):
queue_free() | |
119974 | # Displays a scene inside a frame.
class_name GameView
extends Control
var paused := false setget set_paused
var _viewport := Viewport.new()
onready var _viewport_container = $ViewportContainer as ViewportContainer
onready var _pause_rect := $PauseRect as ColorRect
onready var _scene_tree := get_tree()
func _ready... | |
119981 | tool
class_name Revealer, "./Revealer.svg"
extends Container
const ANIMATION_ICON_DURATION := 0.1
const ANIMATION_REVEAL_DURATION := 0.24
const TOGGLE_OPACITY := 0.65
const TOGGLE_OPACITY_HOVER := 1.0
signal expanded
export var title := "Expand" setget set_title
export var is_expanded := false setget set_is_expande... | |
120342 | [gd_scene load_steps=3 format=2]
[ext_resource path="res://course/lesson-10-the-game-loop/rotating-and-moving/RotateAndMoveSprite.gd" type="Script" id=1]
[ext_resource path="res://course/common/Robot.tscn" type="PackedScene" id=2]
[node name="RotateAndMoveSprite" type="Node2D"]
[node name="Robot" parent="." instance... | |
120419 | [gd_scene load_steps=4 format=2]
[ext_resource path="res://ui/theme/fonts/font_title.tres" type="DynamicFont" id=1]
[ext_resource path="res://ui/theme/panel_normal.tres" type="StyleBox" id=2]
[sub_resource type="Theme" id=1]
default_font = ExtResource( 1 )
[node name="VisualFunctionDefinition" type="PanelContainer"]... | |
120440 | extends Panel
signal used
signal restored
const SWORD := preload("res://course/common/inventory/sword.png")
const SHIELD := preload("res://course/common/inventory/shield.png")
const HEALTH := preload("res://course/common/inventory/healing_heart.png")
const GEMS := preload("res://course/common/inventory/gems.png")
co... | |
120538 | [gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://addons/gdscript-slice-exporter/collections/SceneProperties.gd" type="Script" id=1]
[ext_resource path="res://course/lesson-12-using-variables/fixing_error/FixingError.tscn" type="PackedScene" id=2]
[resource]
script = ExtResource( 1 )
scene... | |
120621 | When programs stop responding on your computer, it's often due to an infinite loop!"
answer_options = [ "It would draw squares infinitely until the program is terminated", "It would draw 10 squares", "It would draw 20 squares" ]
valid_answers = [ "It would draw squares infinitely until the program is terminated" ]
is_m... | |
120692 | [gd_scene load_steps=2 format=2]
[ext_resource path="res://course/lesson-22-functions-return-values/convert-grid-coordinates/ConvertGridCoordinates.gd" type="Script" id=1]
[node name="ConvertGridCoordinates" type="Node2D"]
script = ExtResource( 1 )
[node name="Camera2D" type="Camera2D" parent="."]
current = true | |
120727 | [gd_resource type="Resource" load_steps=25 format=2]
[ext_resource path="res://resources/Lesson.gd" type="Script" id=1]
[ext_resource path="res://resources/ContentBlock.gd" type="Script" id=2]
[ext_resource path="res://resources/QuizChoice.gd" type="Script" id=3]
[ext_resource path="res://course/Documentation.tres" ty... | |
120765 | [gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://addons/gdscript-slice-exporter/collections/SceneProperties.gd" type="Script" id=1]
[ext_resource path="res://course/lesson-8-defining-variables/define-health-variable/DefineHealthVar.tscn" type="PackedScene" id=2]
[resource]
script = ExtRes... | |
120803 | [gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://course/lesson-14-multiplying/reducing_damage/ReducingDamage.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/gdscript-slice-exporter/collections/SceneProperties.gd" type="Script" id=2]
[resource]
script = ExtResource( 2 )
sce... | |
120819 | tool
extends Path2D
const COLOR_GREY := Color("928fb8")
export var graph_size := Vector2.ONE * 250
export var text_x := "x-axis"
export var text_y := "y-axis"
export var axis_increments := 50
export var show_speed := 400
var _line
var _points := []
var _last_point := Vector2.ZERO
# Need a draw offset as the scene is... | |
120852 | {
"patterns":
[
["Expected", "type for"],
["Expected type after"],
],
"raw":
[
"Expected a type for the class variable.",
"Expected a type for the class constant.",
"Expected a type for the variable.",
"Expected a type for an argument.",
"Expected a return type for the function.",
"Exp... | |
120929 | func assert_file_exists(file_path):
var disp = 'expected [' + file_path + '] to exist.'
var f = File.new()
if(f.file_exists(file_path)):
_pass(disp)
else:
_fail(disp)
# ------------------------------------------------------------------------------
# Asserts that a file should not exist
# ----------------------... | |
121043 | extends Object
# ResourceLoader is unreliable when it comes to cache.
# Sub-resources get cached regardless of the argument passed to load function.
# This is a workaround that generates a new file on a fly,
# while making sure that there is no cache record for it.
# This file is then used to load the resource, after ... | |
121046 | "Using own name in class file is not allowed (creates a cyclic reference)"
"Can't load global class %IDENTIFIER%, cyclic reference?"
"Identifier not found: %IDENTIFIER%"
"'self' not present in static function!"
"Invalid native class type '%NATIVE_TYPE%'."
"Parser bug: unresolved data type."
"Attempt to call a non-ident... | |
121053 | # Compiling for web
Because I need this often, here's a one-liner to compile for web:
```sh
rm -rf build/web && \
mkdir -p build/web && \
godot -v --export "HTML5" build/web/index.html && \
cp -r html_export/static/* build/web && \
cd build/web && \
python -m http.server 8000 && \
cd -
```
(This assumes ... | |
121069 | # Global signal bus registered as an auto-loaded node. Allows us to emit events
# different nodes listen to without having to bubble signals through long chains
# of UI nodes.
extends Node
signal lesson_started(lesson)
signal lesson_completed(lesson)
signal lesson_reading_block(block, previous_blocks)
signal quiz_comp... | |
121094 | extends KinematicBody2D
export var jump_speed := 200
export var jump_max_height := 100.0
export var gravity := 4000
var is_walking := false
onready var animated_sprite := $AnimatedSprite as AnimatedSprite
var _velocity_y = 0.0
var _jump_starting_point := 0.0
func _ready() -> void:
add_to_group("Player")
func _... | |
121098 | [gd_scene load_steps=2 format=2]
[ext_resource path="res://game_demos/run_and_jump/Obstacle.gd" type="Script" id=1]
[node name="Area2D" type="Area2D"]
script = ExtResource( 1 )
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2( 0, -0.203634 )
[node name="Sprite" type="Sprite" pare... | |
121105 | [gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://addons/gdscript-slice-exporter/collections/ScriptProperties.gd" type="Script" id=1]
[ext_resource path="res://game_demos/run_and_jump/Player.gd" type="Script" id=2]
[resource]
script = ExtResource( 1 )
nodes_paths = [ NodePath("Level/Player... | |
121151 | - Fix editor crash when unsupported `Resource` is dropped in scene ([GH-89126](https://github.com/godotengine/godot/pull/89126)).
- Update lock and group button state when selection changed in CanvasItemEditor ([GH-89132](https://github.com/godotengine/godot/pull/89132)).
- Expose TileMapLayer ([GH-89179](https://githu... | |
121153 | - Fix `Path3D` tilt gizmo raycasting against local plane ([GH-91109](https://github.com/godotengine/godot/pull/91109)).
- Simplify the GPUParticles3D editor gizmo to improve readability ([GH-91226](https://github.com/godotengine/godot/pull/91226)).
- Add MultiNodeEdit support to MeshInstance3D editor ([GH-91620](https:... | |
121177 | revent race condition on initial breakpoints from DAP ([GH-84895](https://github.com/godotengine/godot/pull/84895)).
- Do not bother with line colors if `line_number_gutter` is not yet calculated ([GH-84907](https://github.com/godotengine/godot/pull/84907)).
- Improve search/replace bar behavior ([GH-84932](https://git... | |
121179 | ix data race against `EditorFileSystem.scanning_changes_done` ([GH-88124](https://github.com/godotengine/godot/pull/88124)).
- Use `SafeFlag` for `EditorHTTPServer.server_quit` ([GH-88155](https://github.com/godotengine/godot/pull/88155)).
- Use highlighted version of the tab icon in the bottom file system dock ([GH-88... | |
121199 | iversal: Fix texture decompression ([GH-88676](https://github.com/godotengine/godot/pull/88676)).
- Properly calculate binormal when creating SurfaceTool from arrays ([GH-88725](https://github.com/godotengine/godot/pull/88725)).
- Multiple fixes for compressed meshes ([GH-88738](https://github.com/godotengine/godot/pul... | |
121295 | // This service worker is required to expose an exported Godot project as a
// Progressive Web App. It provides an offline fallback page telling the user
// that they need an Internet connection to run the project if desired.
// Incrementing CACHE_VERSION will kick off the install event and force
// previously cached r... | |
121412 | #ifndef DISABLE_LIGHT_SPOT
for (uint i = 0u; i < MAX_FORWARD_LIGHTS; i++) {
if (i >= spot_light_count) {
break;
}
#if defined(USE_LIGHTMAP) && !defined(DISABLE_LIGHTMAP)
if (spot_lights[spot_light_indices[i]].bake_mode == LIGHT_BAKE_STATIC) {
continue;
}
#endif
light_process_spot(spot_light_indices[i],... | |
121413 | #ifndef USE_VERTEX_LIGHTING
light_compute(normal, normalize(directional_lights[directional_shadow_index].direction), normalize(view), directional_lights[directional_shadow_index].size, directional_lights[directional_shadow_index].color * directional_lights[directional_shadow_index].energy, true, directional_shadow, f0... | |
121754 | /**************************************************************************/
/* http_client_tcp.h */
/**************************************************************************/
/* This file is part of: */
/* ... | |
121767 | public:
enum ThreadLoadStatus {
THREAD_LOAD_INVALID_RESOURCE,
THREAD_LOAD_IN_PROGRESS,
THREAD_LOAD_FAILED,
THREAD_LOAD_LOADED
};
enum LoadThreadMode {
LOAD_THREAD_FROM_CURRENT,
LOAD_THREAD_SPAWN_SINGLE,
LOAD_THREAD_DISTRIBUTE,
};
struct LoadToken : public RefCounted {
String local_path;
String ... | |
121769 | /**************************************************************************/
/* stream_peer_tcp.h */
/**************************************************************************/
/* This file is part of: */
/* ... | |
121784 | /**************************************************************************/
/* json.h */
/**************************************************************************/
/* This file is part of: */
/* ... | |
121836 | /**************************************************************************/
/* transform_interpolator.h */
/**************************************************************************/
/* This file is part of: */
/* ... | |
121838 | /**************************************************************************/
/* quaternion.h */
/**************************************************************************/
/* This file is part of: */
/* ... | |
121894 | struct [[nodiscard]] Vector3 {
static const int AXIS_COUNT = 3;
enum Axis {
AXIS_X,
AXIS_Y,
AXIS_Z,
};
union {
struct {
real_t x;
real_t y;
real_t z;
};
real_t coord[3] = { 0 };
};
_FORCE_INLINE_ const real_t &operator[](int p_axis) const {
DEV_ASSERT((unsigned int)p_axis < 3);
return... | |
121895 | Vector3 Vector3::slerp(const Vector3 &p_to, real_t p_weight) const {
// This method seems more complicated than it really is, since we write out
// the internals of some methods for efficiency (mainly, checking length).
real_t start_length_sq = length_squared();
real_t end_length_sq = p_to.length_squared();
if (un... | |
121896 | bool Vector3::operator<(const Vector3 &p_v) const {
if (x == p_v.x) {
if (y == p_v.y) {
return z < p_v.z;
}
return y < p_v.y;
}
return x < p_v.x;
}
bool Vector3::operator>(const Vector3 &p_v) const {
if (x == p_v.x) {
if (y == p_v.y) {
return z > p_v.z;
}
return y > p_v.y;
}
return x > p_v.x;
}... | |
121925 | #ifndef OBJECT_H
#define OBJECT_H
#include "core/extension/gdextension_interface.h"
#include "core/object/message_queue.h"
#include "core/object/object_id.h"
#include "core/os/rw_lock.h"
#include "core/os/spin_lock.h"
#include "core/templates/hash_map.h"
#include "core/templates/hash_set.h"
#include "core/templates/li... | |
121926 | struct PropertyInfo {
Variant::Type type = Variant::NIL;
String name;
StringName class_name; // For classes
PropertyHint hint = PROPERTY_HINT_NONE;
String hint_string;
uint32_t usage = PROPERTY_USAGE_DEFAULT;
// If you are thinking about adding another member to this class, ask the maintainer (Juan) first.
_F... | |
122003 | #ifndef TYPED_ARRAY_H
#define TYPED_ARRAY_H
#include "core/object/object.h"
#include "core/variant/array.h"
#include "core/variant/binder_common.h"
#include "core/variant/method_ptrcall.h"
#include "core/variant/type_info.h"
#include "core/variant/variant.h"
template <typename T>
class TypedArray : public Array {
pub... | |
122012 | uint64_t get_indexed_size() const;
/* Keying */
static bool is_keyed(Variant::Type p_type);
typedef void (*ValidatedKeyedSetter)(Variant *base, const Variant *key, const Variant *value, bool *valid);
typedef void (*ValidatedKeyedGetter)(const Variant *base, const Variant *key, Variant *value, bool *valid);
type... | |
122202 | #!/usr/bin/env python3
import argparse
import contextlib
import os
import socket
import subprocess
import sys
from http.server import HTTPServer, SimpleHTTPRequestHandler
from pathlib import Path
# See cpython GH-17851 and GH-17864.
class DualStackServer(HTTPServer):
def server_bind(self):
# Suppress exc... | |
122217 | /**************************************************************************/
/* http_client_web.h */
/**************************************************************************/
/* This file is part of: */
/* ... | |
122257 | const Features = {
/**
* Check whether WebGL is available. Optionally, specify a particular version of WebGL to check for.
*
* @param {number=} [majorVersion=1] The major WebGL version to check for.
* @returns {boolean} If the given major version of WebGL is available.
* @function Engine.isWebGLAvailable
*... | |
122264 | <?xml version="1.0" encoding="UTF-8" ?>
<class name="EditorExportPlatformWeb" inherits="EditorExportPlatform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Exporter for the Web.
</brief_description>
<description>
The Web exporter customize... | |
122450 | boolean handleMouseEvent(final MotionEvent event, int eventActionOverride, boolean doubleTap) {
return handleMouseEvent(event, eventActionOverride, event.getButtonState(), doubleTap);
}
boolean handleMouseEvent(final MotionEvent event, int eventActionOverride, int buttonMaskOverride, boolean doubleTap) {
final f... | |
123212 | {
const Vector3 vector_x = Vector3(1, 0, 0);
const Vector3 vector_y = Vector3(0, 1, 0);
const Vector3 vector_z = Vector3(0, 0, 1);
const Vector3 a = Vector3(3.5, 8.5, 2.3);
const Vector3 b = Vector3(5.2, 4.6, 7.8);
CHECK_MESSAGE(
vector_x.cross(vector_y) == vector_z,
"Vector3 cross product of X and Y should... | |
123239 | {
// Arbitrary Euler angles.
Vector3 euler_yxz(Math::deg_to_rad(31.41), Math::deg_to_rad(-49.16), Math::deg_to_rad(12.34));
// Basis vectors from online calculation of rotation matrix.
Vector3 i_unit(0.5545787, 0.1823950, 0.8118957);
Vector3 j_unit(-0.5249245, 0.8337420, 0.1712555);
Vector3 k_unit(-0.6456754, -0.... | |
123381 | /**************************************************************************/
/* test_button.h */
/**************************************************************************/
/* This file is part of: */
/* ... | |
123389 | {
List<Node *> nodes;
SceneTree::get_singleton()->get_nodes_in_group("nodes", &nodes);
CHECK(nodes.is_empty());
SceneTree::get_singleton()->get_nodes_in_group("other_nodes", &nodes);
CHECK(nodes.is_empty());
node1->add_to_group("nodes");
node2->add_to_group("other_nodes");
node1_1->add_to_group("nodes... | |
123398 | {
// Cameras need a viewport to know how to compute their frustums, so we make a fake one here.
Camera3D *test_camera = memnew(Camera3D);
SubViewport *mock_viewport = memnew(SubViewport);
// 4:2.
mock_viewport->set_size(Vector2(400, 200));
SceneTree::get_singleton()->get_root()->add_child(mock_viewport);
mock_vi... | |
123406 | {
SubViewport *mock_viewport = memnew(SubViewport);
Camera2D *test_camera = memnew(Camera2D);
mock_viewport->set_size(Vector2(400, 200));
SceneTree::get_singleton()->get_root()->add_child(mock_viewport);
mock_viewport->add_child(test_camera);
SUBCASE("Anchor mode") {
test_camera->set_anchor_mode(Camera2D::ANC... | |
123424 | {
SIGNAL_WATCH(node_i, SceneStringName(mouse_entered));
SIGNAL_WATCH(node_i, SceneStringName(mouse_exited));
Array signal_args;
signal_args.push_back(Array());
node_i->set_mouse_filter(Control::MOUSE_FILTER_PASS);
node_j->set_mouse_filter(Control::MOUSE_FILTER_PASS);
// Move to Control node_j.
... | |
123609 | <?xml version="1.0" encoding="UTF-8" ?>
<class name="PhysicsBody3D" inherits="CollisionObject3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Abstract base class for 3D game objects affected by physics.
</brief_description>
<description>
... | |
123616 | <?xml version="1.0" encoding="UTF-8" ?>
<class name="BaseButton" inherits="Control" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Abstract base class for GUI buttons.
</brief_description>
<description>
[BaseButton] is an abstract base clas... | |
123617 | <?xml version="1.0" encoding="UTF-8" ?>
<class name="MeshInstance3D" inherits="GeometryInstance3D" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Node that instances meshes into a scenario.
</brief_description>
<description>
MeshInstance3D ... | |
123618 | <methods>
<method name="bake_mesh_from_current_blend_shape_mix">
<return type="ArrayMesh" />
<param index="0" name="existing" type="ArrayMesh" default="null" />
<description>
Takes a snapshot from the current [ArrayMesh] with all blend shapes applied according to their current weights and bakes it to the... | |
123627 | <?xml version="1.0" encoding="UTF-8" ?>
<class name="Viewport" inherits="Node" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Abstract base class for viewports. Encapsulates drawing and interaction with a game world.
</brief_description>
<des... | |
123628 | <methods>
<method name="find_world_2d" qualifiers="const">
<return type="World2D" />
<description>
Returns the first valid [World2D] for this viewport, searching the [member world_2d] property of itself and any Viewport ancestor.
</description>
</method>
<method name="find_world_3d" qualifiers="const... | |
123664 | <?xml version="1.0" encoding="UTF-8" ?>
<class name="ProjectSettings" inherits="Object" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Stores globally-accessible variables.
</brief_description>
<description>
Stores variables that can be acc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.